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

Opens an explorer.exe file browser window for the current working directory or specified dir (Fixed)
This alternative either opens the current working directory by just issuing the open function in the commandline. Or you can specify what directory you would like to open. Example: open /cygdrive/c/Windows Usage: open [path] When no option is specified it will open the current working directory

Fetch the current human population of Earth
Fetches the world population JSON data from the US census and parses it uses jshon

Quick screenshot
Requires ImageMagick. Takes a screenshot 5 seconds after it's run and saves it as desktop_screenshot.jpg Particularly handy when made into a menu option or button.

Remove a range of lines from a file

Convert all .flac from a folder subtree in 192Kb mp3
find . -type f -iname '*.flac' # searches from the current folder recursively for .flac audio files | # the output (a .flac audio files with relative path from ./ ) is piped to while read FILE; do FILENAME="${FILE%.*}"; flac -cd "$FILE" | lame -b 192 - "${FILENAME}.mp3"; done # for each line on the list: # FILE gets the file with .flac extension and relative path # FILENAME gets FILE without the .flac extension # run flac for that FILE with output piped to lame conversion to mp3 using 192Kb bitrate

How long has this disk been powered on

simple du command to give size of next level of subfolder in MB
If you're only using -m or -k, you will need to remember they are either in Megabyte or kilobyte forms. So by using -B, it gives you the unit of the size measurement, which helps you from reading the result faster. You can try with -B K as well.

move you up one directory quickly
Alias a single character 'b' to move to parent directory. Put it into your .bashrc or .profile file. Using "cd .." is one of the most repetitive sequence of characters you'll in the command line. Bring it down to two keys 'b' and 'enter'. It stands for "back" Also useful to have multiple: alias b='cd ../' alias bb='cd ../../' alias bbb='cd ../../../' alias bbbb='cd ../../../../'

Twit Amarok "now playing" song
Share your "now playing" Amarok song in twitter!

remove password from openssl key file
Strip a password from a openssl key to use with apache httpd server


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: