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

play high-res video files on a slow processor
Certain codecs in high res don't play so well on my Dell Mini 9. Using this command, I can play just about anything and it keeps the sound in sync to boot!

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"

from within vi, pipe a chunk of lines to a command line and replace the chunk with the result
The vi key sequence !}command will send the file contents from the cursor to the next blank line as STDOUT to the command specified and replace that sequence of file lines with the output of the command. For example: sorting a block of data - !}sort The sequence !{command will do the same but "upwards" (from the current position towards the start of the file.

Rename files in batch

Print out a man page
man -t manpagename gives a postscript version of said man page. You then pipe it to ls, and assuming you have cups set up, it prints in your default printer.

Install pip with Proxy
Installs pip packages defining a proxy

Test file system type before further commands execution
Exclude 400 client hosts with NFS auto-mounted home directories. Easily modified for inclusion in your scripts.

pretend to be busy in office to enjoy a cup of coffee
Create a progress dialog with custom title and text using zenity.

Create a directory and cd into it
This creates a bash function `take` that you can call with the name of the directory as the first parameter. Add the function to ~/.bashrc to have it available anytime.

Who has the most Apache connections.
This will tell you who has the most Apache connections by IP (replace IPHERE with the actual IP you wish to check). Or if you wish, remove | grep -c IPHERE for the full list.


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: