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

ROT13 whole file in vim.
gg puts the cursor at the begin g? ROT13 until the next mov G the EOF

Prepare B&W scans for clean looking, searchable PDF
Scan pages in, clean them up in an image editor, save to individual files. Use this command to convert each page to PDF. Combine in Acrobat Professional, and use the built-in OCR with the "Searchable Image (Exact)" option. Gives excellent image quality and file size (avoids awful JPEG image recompression that Acrobat and other OCR systems tend to do.)

Find 10 largest files in git history

Create a temporary file
To create directory, use: $ tempdir=$(/bin/mktemp -d)

Retry the previous command until it exits successfully
Executes the previously-run command constantly until it returns 0 (success). Put a

Create black and white image
Use ImageMagick to create a "black and white" copy of an image.

Jump up to any directory above the current one
Usage: upto directory

count and number lines of output, useful for counting number of matches
Write each FILE to standard output, with line numbers added. With no FILE, or when FILE is -, read standard input.

Speed up upgrades for a debian/ubuntu based system.
Please install aria2c before you try the above command. On ubuntu the command to install aria2c would be: $sudo aptitude install aria2

Recursively execute command on directories (.svn, permissions, etc)
The above command will set the GID bit on all directories named .svn in the current directory recursively. This makes the group ownership of all .svn folders be the group ownership for all files created in that folder, no matter the user. This is useful for me as the subversion working directory on my server is also the live website and needs to be auto committed to subversion every so often via cron as well as worked on by multiple users. Setting the GID bit on the .svn folders makes sure we don't have a mix of .svn metadata created by a slew of different users.


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: