All commands (14,212)

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

Detach a process from the current shell
Continue to execute the command in background even though quitting the shell.

calculate how much bogomips one cpu core has (assuming you have 4 cores).
on some distro's you have to replace "BogoMIPS" with "bogomips".

Show all listening and established ports TCP and UDP together with the PID of the associated process
Easy to remenber. Fot TCP only use: netstat -plant

add files to existing growable DVD using growisofs
replace "directory name with files to add to DVD" with actual directory containing files you want to add to growable DVD

Find processes stuck in dreaded "D" state aka IO Wait
Lots of fun to run on nfs clients when the server or network connection is having issues

validate the syntax of a perl-compatible regular expression
Place the regular expression you want to validate between the forward slashes in the eval block.

Export unpushed files list

Create md5sum of a directory

Help shell find freshly installed applications (re: PATH)
Immediately after installing things into your PATH (e.g. under /usr/bin), currently open shells cannot find them ("zsh: command not found"). Use rehash to get the shell to rescan available executables.

Get top N files in X directory
You can simply run "largest", and list the top 10 files/directories in ./, or you can pass two parameters, the first being the directory, the 2nd being the limit of files to display. Best off putting this in your bashrc or bash_profile file


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: