Category Archives: shell

I love cURL

Sometime, cURL is a useful tools. And useful to download data from the web.
And scripting to download data. It support major protocol, like ftp, http, https. It is useful for testing, stuff too.

I am working on a pet project, involve twitter, I am try to see how it look like so i download a twitter feed using cURL. And it is really easy. Thanks to the twitter REST interface.

curl –basic –user $username:$password

All in one line, This is for json, if want xml, the replace json with xml. You might want to save it to a file. You can just redirect to a file. Just replace anything start with the $ with the appropriate value.

curl –basic –user $username:$password > $filename

fun with bash: append text to a file

There is time when we need to edit a file on linux, or unix for that matter, and usually a configuration file. And to me at least, it is usually append to end of a file.

On the other hand, unix got many many, text manipulating utilities, and often, one liner to do text manipulation exist. From cat, to sed. And some an echo will do.

To append a line to a file, it just

echo “your text”>> yourFile

here’s a bit explaination, in layman term

echo “your text”

will by default, print to your screen, which comes to


which means, redirect output to, somewhere. Another variation is, >, the difference is that, this will replace, the whole thing. >> will append

>> yourFile

means redirect to your file.

And there you go, a one line to append a file.