All commands (14,187)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.

Share Your Commands


Check These Out

ping a range of IP addresses
nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc.

Use top to monitor only all processes with the same name fragment 'foo'
Like command 10870, but no need for sed

Show recent earthquakes in Bay Area
To see only earthquakes for today, add another pipe to egrep "`date '+%Y/%m/%d'`"

Append stdout and stderr to a file, and print stderr to the screen [bash]
Useful for cron jobs -- all output will be logged but only errors will cause email to be sent. NB the order of "2>&1" and ">> logfile" is important, it doesn't work if you reverse them (everything goes to the logfile, nothing left for tee).

pipe output of a command to your clipboard
In turn you can get the contents of your clipboard by typing xsel by itself with no arguments: $ xsel This command requires you to install the xsel utility which is free

Advanced python tracing
Trace python statement execution and syscalls invoked during that simultaneously

list block devices
Shows all block devices in a tree with descruptions of what they are.

Compress a series of png pictures to an avi movie.
cd /path/to/your/png_pics mencoder "mf://*.png" -mf fps=2 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4 then you can get a movie named output.avi.

Find C/C++ source code comments
This is a naive way of finding source code comments in source code files that use C-like comments: // and /*...*/

Show the key code for keyboard events include the Fn keys
The keycodes are a result of pressing: Mute (Fn+F1) a


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: