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

GRUB2: set Super Mario as startup tune
I'll let Slayer handle that. Raining Blood for your pleasure.

Create a 5 MB blank file via a seek hole
Similar to the original, but is much faster since it only needs to write the last byte as zero. A diff on testfile and testfile.seek will return that they are the same.

Extract all GPS positions from a AVCHD video.

Install pip with Proxy
Installs pip packages defining a proxy

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Measure, explain and minimize a computer's electrical power consumption
Run this command as root to get enough stats. It works on AMD and Intel machines, including desktops. If ran on a laptop it'll give you suggestions on extending your battery life. You'll need to install PowerTOP if you don't have, via 'apt-get install powertop', etc. To grep the output use: sudo powertop -d | grep ... The many command suggestions PowerTOP gives you alone will increase your command-line fu!

Check every URL redirect (HTTP status codes 301/302) with curl
curl -sLkIv --stderr - https://t.co/2rQjHfptZ8 -s: silences the output when piped to a different command -L: follow every redirect -k: ignores certificate errors -I: just request the headers -v: be verbose --stderr - : redirect stderr to stdout https://t.co/2rQjHfptZ8: URL to check for redirects piped to grep -i location: -i: grep target text ignoring case location: : greps every string containing "location:" piped to awk {'print $3'} prints the third column in every string piped to sed '/^$/d' removes blank lines

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Use Vim to convert text to HTML.
``vimhtml somefile.txt`` will open vim for the HTML convertion and close it immediately after its done, leaving you with somefile.html which you can later use in your website or whatever.

find the longest command in your history


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: