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

Tail a log-file over the network
Netcat is used to serve a log-file over a network on port 1234. Point a browser to the specified server/port combo to view log-file updates in real-time.

Switch to the previous branch used in git(1)
Very useful if you keep switching between the same two branches all the time.

find files in a date range
Example above will recursively find files in current directory created/modified in 2010.

Search manpages for a keyword
Search manpages for a keyword. Very useful when you don't know where to find the information.

Convert a flv video file to avi using mencoder

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

Create md5sum of a directory

Speed up builds and scripts, remove duplicate entries in $PATH. Users scripts are oftern bad: PATH=/apath:$PATH type of thing cause diplicate.
Thanks to the authors of: $ awk '!x[$0]++' and the author of: $ joinargs() { (local IFS="$1"; shift && echo "$*") } and others, we can have a fast Linux or android. IMPORTANT if you find a priority order problem in PATH you can push a path directory to the front without duplication as follows: $ PATH=/bin:$PATH then ... Check duplication with: $ echo $PATH|tr : '\n'|sort|uniq -d Finally do a very neat line by line list of $PATH: $ echo "${PATH//:/$'\n'} The speed up is very noticeable for android, and builds on Linux Ubantu are much faster with make and scripts. I will update the command on request. Timothy from SONY

Find and copy files from subdirectories to the current directory

RDP through SSH tunnel
This command will: 1. open an SSH tunnel to 2. go to background 3. wait for 10 seconds for the connection 4. during the 10 seconds wait it will localy run 'rdesktop' to connect to the remote host through the created SSH tunnel. Password-less log in can be achieved (when server allows it) by adding '-p ' to the 'rdesktop' command


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: