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

Working random fact generator
Though without infinite time and knowledge of how the site will be designed in the future this may stop working, it still will serve as a simple straight forward starting point. This uses the observation that the only item marked as strong on the page is the single logical line that includes the italicized fact. If future revisions of the page show failure, or intermittent failure, one may simply alter the above to read. $ wget randomfunfacts.com -O - 2>/dev/null | tee lastfact | grep \ | sed "s;^.*\(.*\).*$;\1;" The file lastfact, can then be examined whenever the command fails.

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"

Remove all mail in Postfix mail queue.

Filter IP's in apache access logs based on use
The first sort is necessary for ips in a list to be actually unique.

List folders containing only PNGs

Docker.io Stop and Remove all processes
Will stop all running containers, then remove all containers **This isn't for selectively handling containers, it removes everything**

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"

Quick notepad
Quick write some notes to a file with cat. Ctrl+C when you have finish.

Change Gnome wallpaper
You can use this in a script which rotates wallpapers from a directory at each login.

enable all bash completions in gentoo


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: