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

Find out the last times your system was rebooted (for the duration of wtmp).

Binary Clock
Create a binary clock.

encode image to base64 and copy to clipboard
I use it for embedding images in CSS for Stylish, the Firefox addon. Thought it might be useful to others.

Start a command on only one CPU core
This is useful if you have a program which doesn't work well with multicore CPUs. With taskset you can set its CPU affinity to run on only one core.

Install pip with Proxy
Installs pip packages defining a proxy

Encrypt every file in the current directory with 256-bit AES, retaining the original.
The password is stored in the password file, which obviously must be kept secure, encrypted later with gpg, deleted, or whatever you prefer. To decrypt: $ openssl enc -d -aes-256-cbc -salt -in filename.enc -out filename -pass file:/path/to/password-file Alternative ciphers can be used, of course.

Find Duplicate Files, excluding .svn-directories (based on size first, then MD5 hash)
Improvement of the command "Find Duplicate Files (based on size first, then MD5 hash)" when searching for duplicate files in a directory containing a subversion working copy. This way the (multiple dupicates) in the meta-information directories are ignored. Can easily be adopted for other VCS as well. For CVS i.e. change ".svn" into ".csv": $ find -type d -name ".csv" -prune -o -not -empty -type f -printf "%s\n" | sort -rn | uniq -d | xargs -I{} -n1 find -type d -name ".csv" -prune -o -type f -size {}c -print0 | xargs -0 md5sum | sort | uniq -w32 --all-repeated=separate

Unrar multiple directories into current working directory
Grabs all rar files in any current subdirectories and feeds it to unrar. Doesn't work well with things packaged like file.part01.rar. Works best with File.rar. You can recurse into other directories by adding more /*'s

ThePirateBay.org torrent search
usage: tpb searchterm example: tpb the matrix trilogy This searches for torrents from thepiratebay and displays the top results in reverse order, so the 1st result is at the bottom instead of the top -- which is better for command line users

kill a process(e.g. conky) by its name, useful when debugging conky:)


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: