Follow Me: Tweeting from the Linux Command Line

Posted by jun auza On 3/11/2009
Updating Twitter via the command line on Linux is rather easy. But before I'll show you how, let me tell you a short story.

I joined Twitter almost a year ago and only managed to update my status a few times. A very small number of friends followed me and I followed some people as well. I don't really intend to have thousands of followers on Twitter that's why I didn't advertise or mention it here before that I'm tweeting. However, as I noticed that Tech Source from Bohol now has a good number of loyal readers/subscribers, I realize that I should inform everyone that I'm tweeting HERE.

I'm doing this because instead of posting short personal updates on this site, I'm going to do it on Twitter, and I intend to do it more often. Also, I think it will give me the opportunity to get to know some our regular readers (Twitter users) since I often follow those who follow me. So, to everyone who always want to know what I'm doing (or what I’m not doing), follow me.

Now, here’s how to update Twitter from the Linux command line:

1. Install curl with this command (Ubuntu/Debian):

sudo apt-get install curl

2. Create a new file named ‘twitter’ at '/usr/bin' with your favorite text editor:

sudo gedit /usr/bin/twitter

Then, paste this code:

curl --basic --user "yourusername:yourpasswd" --data-ascii "status=`echo $@|tr ' ' '+'`" "" -o /dev/null; echo Message Sent!

*Make sure you replace "yourusername" and "yourpasswd" with your own Twitter username and password. Save and Exit.

3. Give the file executable privileges with this command:

sudo chmod +x /usr/bin/twitter

4. Start tweeting using the command line by typing ‘twitter’ [space] [your message]. See example below:


5. You have just posted a Twitter update via the Linux command line!

Bookmark and Share

Related Posts:


"Action is the real measure of intelligence" ~Napoleon Hill



Google +