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

Extract tarball from internet without local saving
Use `tar xj` for bzip2 archives.

DVD-Rip
Make backups of your home DVDs easily. Other: mencoder dvd://1 -o "$targetDir/$dvdTitle.avi" -aid "$audioID" -ovc x264 -x264encopts qp=26:frameref=3:bframes=15:direct_pred=auto:cabac:weight_b:partitions=all:8x8dct:me=esa:me_range=24:subq=7:mixed_refs:trellis=2:bitrate=1000:nofast_pskip:threads=0 -oac mp3lame

Resample a WAV file with sox
Change the sample rate with sox, the swiss army knife of sound processing.

Fetch the current human population of Earth
They are using json now

Get the absolute path of a file

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Adding leading zeros to a filename (1.jpg -> 001.jpg)
From: http://grml.org/zsh/zsh-lovers.html

Remove embedded fonts from a pdf.
It's sometimes useful to strip the embedded fonts from a pdf, for importing into something like Inkscape. Be warned, this will increase the size of a pdf substantially. I tried this with only gs writing with -sDEVICE=pdfwrite but it doesn't seem to work, so I just pipe postscript output to ps2pdf for the same effect.

Remove a line in a text file. Useful to fix
In this case it's better do to use the dedicated tool

Share a file quickly using a python web server
Raise your hand if you haven't used this at least once to share a directory quickly


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: