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

Copy data using gtar
It copies the entire current working directory to the destination directory with compression enabled.

Bypass with hexencoding, dump /etc/passwd

Display a block of text: multi-line grep with perl
-n reads input, line by line, in a loop sending to $_ Equivalent to while () { mycode } -e execute the following quoted string (i.e. do the following on the same line as the perl command) the elipses .. operator behaves like a range, remembering the state from line to line.

Convert your favorite image in xpm for using in grub
* size must be 640?480 pixels * only has 14 colors * save it in XPM format Edit /boot/grub/menu.lst and add splashimage=(hd0,0)/boot/grub/grubimg.xpm make sure for your path name and hard disk

How to pull out lines between two patterns
This command will display all lines between 2 patterns: word-a and word-b useful for grepping command outputs from file

Google text-to-speech in mp3 format
EDIT: command updated to support accented characters! Works in any of 58 google supported languages (some sound like crap, english is the best IMO). You get a mp3 file containing your query in spoken language. There is a limit of 100 characters for the "q" parameter, so be careful. The "tl" parameter contains target language.

Replaces a color in a PDF document, useful for removing a dark background before printing.
The pdf is first converted to a bitmap, so change "-density" to match your printer resolution. Also be careful about the RAM required. In this example rgb(0,0,0) is replaced by rgb(255,255,255), change to suit your needs.

create ICO file with more than one image
requires imagemagick. -background transparent is of course optional.

quickly backup or copy a file with bash
This inserts timestamp instead of .bak extension.

Extract shortcuts and hostnames from .ssh/config
Spits out table that shows your Host->HostName aliases in ~/.ssh/config


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: