Hide

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.


If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Hide

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:

Hide

News

2011-03-12 - Confoo 2011 presentation
Slides are available from the commandlinefu presentation at Confoo 2011: http://presentations.codeinthehole.com/confoo2011/
2011-01-04 - Moderation now required for new commands
To try and put and end to the spamming, new commands require moderation before they will appear on the site.
2010-12-27 - Apologies for not banning the trolls sooner
Have been away from the interwebs over Christmas. Will be more vigilant henceforth.
2010-09-24 - OAuth and pagination problems fixed
Apologies for the delay in getting Twitter's OAuth supported. Annoying pagination gremlin also fixed.
Hide

Tags

Hide

Functions

Commands by linuxrawkstar from sorted by
Terminal - Commands by linuxrawkstar - 35 results
cat file-that-failed-to-download.zip | curl -C - http://www.somewhere.com/file-I-want-to-download.zip >successfully-downloaded.zip
2009-08-05 13:33:06
Functions: cat
-1

If you are downloading a big file (or even a small one) and the connection breaks or times out, use this command in order to RESUME the download where it failed, instead of having to start downloading from the beginning. This is a real win for downloading debian ISO images over a buggy DSL modem.

Take the partially downloaded file and cat it into the STDIN of curl, as shown. Then use the "-C -" option followed by the URL of the file you were originally downloading.

echo linux|rev
2009-08-04 12:28:44
Functions: echo
Tags: rev
1

NAME

rev - reverse lines of a file or files

SYNOPSIS

rev [file ...]

DESCRIPTION

The rev utility copies the specified files to the standard output, reversing the order of characters in every line. If no files are specified, the standard input is read.

AVAILABILITY

The rev command is part of the util-linux-ng package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.

lynx -head -dump http://slashdot.org|egrep 'Bender|Fry'|sed 's/X-//'
some command|xsel --clipboard
2009-07-08 11:52:48
Tags: clipboard xsel
21

In turn you can get the contents of your clipboard by typing xsel by itself with no arguments:

xsel

This command requires you to install the xsel utility which is free

vmrun list
2009-07-07 12:13:50
0

Shows a list of running virtual machines on a vmware host (workstation/server/esx/etc.)

Again, this command is vmware-specific.

There are also other things you can do with `vmrun`. Just simply type vmrun by itself (no arguments) to get a readout of other things you can do with it.

vmrun start /path/to/virtual_machine.vmx nogui
2009-07-07 12:11:45
0

There is no output from this command. The command boots a virtual machine and you will have to wait for the boot sequence to complete before you can ping or connect to the virtual machine via ssh/rdp/vnc/nx/etc.

mysqldump [options] |gzip ->mysqldump-$(date +%Y-%m-%d-%H.%M.%S).gz
2009-06-12 12:42:59
Functions: date gzip
1

Performs a mysqldump and gzip-compresses the output file with a timestamp in the resulting dump file. Inspect the file for integrity or fun with this command afterward, if you desire:

zcat mysqldump-2009-06-12-07.41.01.tgz | less
wodim cdimage.iso
2009-05-01 21:53:27
8

Does life get much easier? Read up about wodim for an understanding of its origins in relation to the older `cdrecord` utility

vim ~/.purple/pounces.xml
2009-04-28 19:11:39
Functions: vim
Tags: vim pidgin
0

So you keep getting buzzes sounding from pidgin but you can't remember which buddy pounce is causing the beep. Well, cat/edit the ~/.purple/pounces and find out!

ffmpeg -i movie.avi -y -f vcd -vcodec mpeg1video -map 0.0:0.0 -b 1150 -s 352x240 -r 29.97 -g 12 -qmin 3 -qmax 13 -acodec mp2 -ab 224 -ar 44100 -ac 2 -map 0.1:0.1 movie.mpg