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

Create a progress bar over entire window until we count to 1000
https://wuseman.nr1.nu:8080/file/E8AcLVgMPZ2LSJQf/9BD8V8ADYNhR6cca/parallel_print_progress.gif

Preserve user variables when running commands with sudo.
In this case the current user has proxy variable set which allows access to the rpm on the internet but needs root privs to install it. Running sudo -E preserves the current user proxy var and allows the rpm install to be executed with sudo.

Extract audio from a video

Convert multiple flac files to mp3
make sure that flac and lame are installed sudo apt-get install lame flac

Rip a CD/DVD to ISO format.
An easy method to generate ISOs from CD/DVD media.

Monitor dynamic changes in the dmesg log.
Other logs can be monitored similarly, e.g. $ watch "tail -15 /var/log/daemon.log"

Show me a histogram of the busiest minutes in a log file:
Busiest seconds: $ cat /var/log/secure.log | awk '{print substr($0,0,15)}' | uniq -c | sort -nr | awk '{printf("\n%s ",$0) ; for (i = 0; i

Get the current svn branch/tag (Good for PS1/PROMPT_COMMAND cases)
uses just one sed

Convert all .wav to .mp3
Audio convert is a script that uses zenity and lame to transcode virtually any format to any other format provided you have the libraries installed to do so.

diff the same file in two directories.
This is useful when you're diffing two files of the same name in radically different directory trees. For example: Set $ path1='/some/long/convoluted/path/to/all/of/your/source/from/a/long/dead/machine' then $ path2='/local/version/of/same/file' then run the command. Much easier on the eyes when you're looking back across your command history, especially if you're doing the same diff over and over again.


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: