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 music from youtube without download
same as above but dumps the stream to a file.

find and delete empty dirs, start in current working dir

Swap the two last arguments of the current command line
Say you just typed a long command like this: $ rsync -navupogz --delete /long/path/to/dir_a /very/long/path/to/dir_b but you really want to sync dir_b to dir_a. Instead of rewriting all the command line, just type followed by , and your command line will read $ rsync -navupogz --delete /very/long/path/to/dir_b /long/path/to/dir_a

Indent a one-liner.
Bash builtin type also indents the function.

convert video format to youtube flv format

Scan LAN and get Windows host names

Go to the previous sibling directory in alphabetical order
Based on linkinpark342 suggestion. Sometimes you have to browse your way through a lot of sub-directories. This command cd to the previous sub-directory in alphabetical order. For example, if you have the directories "lectures/01-intro", "lectures/02-basic", "lectures/03-advanced" and so on, and your PWD is "02-basic", it jumps to "01-intro".

List only locally modified files with CVS

Close a hanging ssh session
~ is the ssh control character. If you type it after a newline, you can example force close the ssh session. , ~, then . If you want more info, type ~? when you are connecting using ssh. Very useful to kill of any hanging ssh sessions when nothing else works.

list processes with established tcp connections (without netstat)
Uses lsof to list open network connections (file descriptors), grepping for only those in an established state


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: