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

Pipe STDOUT to vim
The hyphen tells vim to open from STDOUT - saves having to create temporary files.

How much RAM is Apache using?
Display the amount of memory used by all the httpd processes. Great in case you are being Slashdoted!

A function to find the newest file in a directory

Watch memcache traffic
View all memcache traffic

Recursive replace of directory and file names in the current directory.
no grep, no perl, no pipe. even better in zsh/bash4: $ for i in **/*oldname*; do "mv $i ${i/oldname/newname/}"; done No find, no grep, no perl, no pipe

Display which distro is installed
Works on nearly all linux distros

BourneShell: Go to previous directory
cd - would return to the previous directory of your cd command. NB: previous dir is always stored in $OLDPWD variable.

Remove a range of lines from a file
Deletes lines to of a file. You must put the end line first in the range for the curly brace expansion, otherwise it will not work properly.

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

Verbosely delete files matching specific name pattern, older than 15 days.


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: