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

auto terminal title change
above line in .bash_profile will give you window title in putty or terminal client when you login to your remote server

Remove security limitations from PDF documents using ghostscript (for Windows)
#4345 also works under windows

use mplayer to watch Apple Movie Trailer instead of quicktime player
http://trailers.apple.com/trailers/ just copy the .mov link and use mplayer to stream

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"

Edit a PDF's metadata using exiftool
Edit the pdf file foo.pdf's metadata. -overwrite_original overwrites the original file (w/o it exiftool creates a new file)

Compress blank lines in VIM
This command will squeeze all consequent blank lines (including those with only space and tab charactes) to one. It will also empty the resulting line (remove the "|s/.*//" part if you don't need that).

Convert "man page" to text file
You can convert any UNIX man page to .txt

Test your total disk IO capacity, regardless of caching, to find out how fast the TRUE speed of your disks are
Depending on the speed of you system, amount of RAM, and amount of free disk space, you can find out practically how fast your disks really are. When it completes, take the number of MB copied, and divide by the line showing the "real" number of seconds. In the sample output, the cached value shows a write speed of 178MB/s, which is unrealistic, while the calculated value using the output and the number of seconds shows it to be more like 35MB/s, which is feasible.

Remove security limitations from PDF documents using ghostscript
Remove security from PDF document using this very simple command on Linux and OSX. You need ghostscript for this baby to work.

Scale,Rotate, brightness, contrast,...with Image Magick
$rotate: the rotate angle $width, $height: width and height to scale to $birghtness: change brighness


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: