What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

UpGuard checks and validates configurations for every major OS, network device, and cloud provider.

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Commands by gean01 from sorted by
Terminal - Commands by gean01 - 6 results
sed -e 's/{/|/' -e 's/}{/|/' -e 's/}/|/' myFile.sub | awk -F "|" 'BEGIN {OFS = "|"} { $2 = $2 - 600; $3 = $3 - 600; print $0 }' | sed -e 's/^|/{/' -e 's/\([0-9]\)|\([0-9]\)/\1}{\2/' -e 's/|/}/' >
2011-08-17 00:31:49
User: gean01
Functions: awk sed

Fix a microdvd (.sub) subtitle timing by making the phrases to appear 600 frames earlier.

curl -s -A "Mozilla" "http://translate.google.com.br/translate_a/t?client=t&text=Hi+world&hl=pt-BR&sl=en&tl=pt&multires=1&ssel=0&tsel=0&sc=1" | awk -F'"' '{print $2}'
2011-07-03 00:11:52
User: gean01
Functions: awk

Translates a string from English to Portuguese by using google translator web service.

curl -A "Mozilla" "http://translate.google.com/translate_tts?tl=en&q=hello+world" > hello.mp3
2011-07-01 20:59:33
User: gean01

Sends a string to google tranlator, which converts it to English speech.

It's possible to create a nice script to do the job for us, such as


curl -A "Mozilla" " /tmp/speak.mp3

mplayer /tmp/speak.mp3

for i in *;do avidemux --video-codec Xvid4 --audio-codec mp3 --load "${i}" --save "`echo "$i" | sed -e 's/\....$//'`.done.mp4" --quit; done
2009-09-11 17:07:38
User: gean01

Convert multiple files using avidemux. Version updated (thanks to the guys who helped me giving me hints about how to improve the command). Works with files whose name contains blank characters.

One of the reasons why I love open source: everyone can take something "done" and improve it to make it better! If u have suggestions, please let me know.

for i in `ls`;do avidemux --video-codec Xvid4 --load $i --save $i.mp4 --quit; done
2009-09-10 01:38:42
User: gean01

Using avidemux to convert multiple files that are in the folder where the command was executed.

ssh root@`for ((i=100; i<=110; i++));do arp -a 192.168.1.$i; done | grep 00:35:cf:56:b2:2g | awk '{print $2}' | sed -e 's/(//' -e 's/)//'`
2009-09-09 04:32:20
User: gean01
Functions: arp awk grep sed ssh

Connect to a machine running ssh using mac address by using the "arp" command