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

Averaging columns of numbers
This example calculates the averages of column one and column two of "file.dat". It can be easily modified if other columns are to be averaged.

Send email with curl and gmail
Required curl version >=7.21; using ~/.netrc for authorization

Check if *hardware* is 32bit or 64bit
CPU flags: rm --> 16-bit processor (real mode) tm --> 32-bit processor (? mode) lm --> 64-bit processor (long mode)

BourneShell: Go to previous directory
cd - would return to the previous directory of your cd command. NB: previous dir is always stored in $OLDPWD variable.

Decode base64-encoded file in one line of Perl
Another option is openssl.

Indent all the files in a project using emacs
use -iname \*[.ch] instead of -iname \*.c -o -iname \*.h

Open Perl module source in your editor
Ever needed to look at the Perl source of an installed module on your system? This works in 90% of cases.

Generate list of words and their frequencies in a text file.

Use Linux coding style in C program
put "-linux" option into $HOME/.indent.pro to make it default

Concatenate video files to YouTube ready output
Takes two input video files and an external audio track and encodes them together to an MPEG-4 DivX output video file with the correct size ready for uploading.


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: