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

Remove a line from a file using sed (useful for updating known SSH server keys when they change)
For example, to remove line 5 from foo, type: vi +5d +wq foo

recursive search and replace old with new string, inside files
recursively traverse the directory structure from . down, look for string "oldstring" in all files, and replace it with "newstring", wherever found also: $ grep -rl oldstring . |xargs perl -pi~ -e 's/oldstring/newstring'

An easter egg built into python to give you the Zen of Python

check open ports without netstat or lsof

Extract neatly a rar compressed file
It's also possible to delay the extraction (echo "unrar e ... fi" |at now+20 minutes) wich is really convenient!

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

Get video information with ffmpeg
I used an flv in my example, but it'll work on any file ffmpeg supports. It says it wants an output file, but it tells what you want to know without one.

Get the 10 biggest files/folders for the current direcotry

Check if port is open on remote machine
Check if port is open, if you don't have ncat on your machine.

Short URLs with is.gd
No curl and no sed, just wget :)


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: