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

Show your current network interface in use

Prettify an XML file
Generated XML files often are poorly formatted. Use this command to properly indent and normalize the file in-place.

Grep Recursively Through Single File Extension
Trac 0.12.2-stable

Find broken symlinks

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by EVACopy http://evacopy.sourceforge.net

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

Print lines in a text file with numbers in first column higher or equal than a value
A text file contains thousands of numbers. This command prints lines were the number is greater or equal than a specified value (134000000).

Clone or rescue a block device
If you use the logfile feature of ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point. http://www.gnu.org/software/ddrescue/ddrescue.html

OpenDns IP update via curl
Your IP is resolved by OpenDns Server (like a caller ID telephone, every server knows who is calling ;-) Change user:password by yours Be Happy

Squish repeated delimiters into one
This can be particularly useful used in conjunction with a following cut command like $echo "hello::::there" | tr -s ':' | cut -d':' -f2 which prints 'there'. Much easier that guessing at -f values for cut. I know 'tr -s' is used in lots of commands here already but I just figured out the -s flag and thought it deserved to be highlighted :)


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: