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

Generate a graph of package dependencies
Requires: imagemagick and graphviz On Debian systems, displays a graph of package dependencies. Works also with other image formats, like svg : $ apt-cache dotty bash | dot -T svg | display

Show one line summaries of all DEB packages installed on Ubuntu based on pattern search
I sometimes want to know what packages are installed on my Ubuntu system. I still haven't figured out how to use aptitude effectively, so this is the next best thing. This allows finding by name. The grep '^ii' limits the display to only installed packages. If this is not specified, then it includes listing of non-installed packages as well.

Write a shell script that removes files that contain a string
Deletes files in the current directory or its subdirectories that match "regexp" but handle directories, newlines, spaces, and other funky characters better than the original #13315. Also uses grep's "-q" to be quiet and quit at the first match, making this much faster. No need for awk either.

alias to close terminal with :q
Put this in your ~/.bashrc file (or the equivalent) If you use vim a lot, this alias will be immediately obvious. Your brain will thank you.

Hide comments
Hide comments and empty lines, included XML comments,

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

pretend to be busy in office to enjoy a cup of coffee
just make some data scrolling off the terminal. wow.

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

move you up one directory quickly
In bash, this turns on auto cd. If a command is just a directory name, it cd's into that directory.

Release memory used by the Linux kernel on caches
The Linux kernel uses unused memory in caches. When you execute "free" you never get the "real" available memory.


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: