Hey there, if you ever heard about Telegram and wanted to use it from the command line on your Linux server, well, you came to the right place! I’ll tell you how to set it up, and don’t worry, it’s easier than it sounds. Just a few simple commands and you’ll be chatting away like a pro!
Now, first things first, you gotta get that telegram-cli tool on your server. Don’t worry, it’s all free and open source, just like a good old village market. All you need to do is run a couple of commands to install it. Once it’s set up, you can use Telegram just like you do on your phone or computer, but all from your command line. Pretty neat, huh?
Step 1: Install telegram-cli
To begin, you’ll need to install telegram-cli. Just run these commands on your Linux server, and you’ll be good to go:
- sudo apt-get update
- sudo apt-get install telegram-cli
- sudo apt-get install libreadline-dev libconfig-dev libssl-dev
- git clone –recursive */vysheng/*
- cd tg
- ./configure
- make
- sudo make install
Once these commands are done, you should see a file called “telegram-cli” in your ./bin folder. That’s the magic tool that lets you talk to your friends on Telegram from the terminal.
Step 2: Set Up Your Account
Okay, so now that you got telegram-cli installed, it’s time to set it up. You gotta link it to your Telegram account. This is just like logging into your phone or the app, but using the command line. Run the command:
- telegram-cli
The program will ask you for your phone number, then it’ll send you a verification code. Just put the code in, and you’re all set. If you want to add a password, it’ll ask you for that too. Simple stuff, right? Just follow the prompts and you’ll be ready to go!
Step 3: Send Messages
Once you’ve got your account set up, you can start sending messages from the command line. To send a message to someone, you’ll need their username. It’s just like texting on your phone, except you’re typing commands instead. Here’s how you send a message:
- msg username “Your message here”
So if you wanted to send a message to your friend Mary, it’d look something like this:
- msg mary “Hey Mary, how are ya?”
That’s it! Your message gets sent just like that. You can do all kinds of stuff with telegram-cli. Want to check your message history? You can do that. Want to see who’s online? Easy peasy! There’s even a way to check your stats, just like looking at how many eggs you’ve got in your basket.
Step 4: Explore More Commands
Now, telegram-cli is a full-blown Telegram client, so there’s a lot you can do with it. You can list your contacts, get a history of your messages, or even look at stats to see how much you’ve been chatting. All you need to do is remember the commands, and you’re golden. Here’s a few more commands to get you started:
- contacts – View all your contacts
- history – See your message history
- stats – Check your chat stats
As you can see, it’s all pretty straightforward. Once you get the hang of it, you’ll be sending messages and managing your chats like you’ve been using the command line for years. It’s just like riding a bike, once you learn, you won’t forget!
Conclusion
So there you have it, folks! Now you know how to use Telegram right from your Linux terminal. It’s fast, it’s easy, and it’ll save you from opening up the app on your phone every time you wanna send a message. Whether you’re running a server or just like the command line, telegram-cli is a handy little tool to have. Now go ahead, give it a try, and start sending some messages from the terminal!
Tags:[telegram-cli, command line, Telegram, Linux server, messaging, command-line tools, open-source]