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

Start a HTTP server which serves Python docs
I use this command to start a local Python document server over HTTP port 8888.

Define a quick calculator function
defines a handy function for quick calculations from cli. once defined: $ ? 10*2+3

Auto-log commands
A quick alias I use right before logging into a server so that I have a log of the transactions as well as the ability to re-connect from another computer. Useful for when your boss says "what commands did you run again on that server?" and you had already closed the terminal ;) I wrapped it in a script now, with more features, but this is the heart of it. Never leave home without it.

list files recursively by size

Stop long commands wrapping around and over-writing itself in the Bash shell
add the command either in /etc/profile or ~/.bash_profile so that this is available to your shell.

Unzip multiple files with one command
With this command you can easily unzip multiple zip files with just one command. All you need to do is to use single quotes.

Shows space used by each directory of the root filesystem excluding mountpoints/external filesystems (and sort the output)
Excludes other mountpoints with acavagni's "mountpoint" idea, but with -exec instead of piping to an xargs subshell. Then, calling "du" only once with -exec's "+" option. The first "\! -exec" acts as a test so only those who match are passed to the second "-exec" for du.

Show the UUID of a filesystem or partition
Shows the UUID of the given partition (here /dev/sda7). Doesn't need to be root.

Look for English words in /dev/urandom
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt

Rename files in batch


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: