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

Find pages returning 404 errors in apache logs
Finds the top ten pages returning an http response code of 404 in an apache log.

Print a list of all hardlinks in the working directory, recursively
libpurple likes to hardlink files repeatedly. To ignore libpurple, use sed: | sed '/\.\/\.purple/d'

Using a single sudo to run multiple && arguments
Bash's here string

Verify if user account exists in Linux / Unix

Perl Command Line Interpreter
Read, Evaluate, Print, Loop - REPL

Shell function to exit script with error in exit status and print optional message to stderr
USAGE: die ERRNUM [MESSAGE]

Reverse SSH
this command from the source server and this follow in the destination server: ssh user@localhost -p 8888

Check the package is installed or not. There will show the package name which is installed.
The ^python$ is a package name patten. You can change whatever you want.

Delete all flash cookies.
Maybe you want first check which files will be deleted: $ find $HOME -name '*.sol' -exec echo rm {} \;

Set CDPATH to ease navigation
CDPATH tells the cd command to look in this colon-separated list of directories for your destination. My preferred order are 1) the current directory, specified by the empty string between the = and the first colon, 2) the parent directory (so that I can cd lib instead of cd ../lib), 3) my home directory, and 4) my ~/projects directory.


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: