What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.

If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags





Commands by rdc from sorted by
Terminal - Commands by rdc - 8 results
du -ks .[^.]* * | sort -n
2015-05-08 12:26:34
User: rdc
Functions: du sort
Tags: du usage disk

This command summarizes the disk usage across the files and folders in a given directory, including hidden files and folders beginning with ".", but excluding the directories "." and ".."

It produces a sorted list with the largest files and folders at the bottom of the list

du -xks * | sort -n
2013-07-18 16:10:28
User: rdc
Functions: du sort

This command is useful for finding out which directories below the current location use the most space. It is summarised by directory and excludes mounted filesystems. Finally it is sorted by size.

find . -cnewer <file a> -and ! -cnewer <file b>
2012-08-15 21:57:42
User: rdc
Functions: find
Tags: find

This command finds all the files whose status has changed between the ctime of the older and newer .

Very useful if you can see from an ls listing a block of consecutive files you want to move or delete, but can't figure out exactly the time range by date.

export HISTFILE="$HOME/.bash_history-$(hostname -s)"
2012-05-01 13:23:15
User: rdc
Functions: export

On systems where your home directory is shared across different machines, your bash history will be global, rather than being a separate history per machine. This setting in your .bashrc file will ensure that each machine has its own history file.

time dd if=/dev/zero of=dummy_file bs=512k count=200
2012-04-20 13:47:27
User: rdc
Functions: dd time

Write 200 blocks of 512k to a dummy file with dd, timing the result. The is useful as a quick test to compare the performance of different file systems.

ln -nsf <TARGET> <LINK>
2011-07-14 14:07:06
User: rdc
Functions: ln
Tags: Linux symlinks

Instead of deleting an existing symlink and then re-creating it pointing at the new location, it is possible to perform the same action with this one command.

Interesting discussion on whether this is possible to do atomically here: http://answers.google.com/answers/threadview?id=526119

http_proxy=<proxy.server:port> wget <url>
2011-03-30 13:06:19
User: rdc
Functions: wget

On a machine behind a firewall, it's possible to pass the proxy server address in as a prefix to wget to avoid having to set it as an environment variable first.

wget -e robots=off -E -H -k -K -p http://<page>