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

Propagate a directory to another and create symlink to content
Lndir create from source directory to destination directory a full symlink tree of all contents of source directory, really useful for propagate changes from a directory to another.

Make a DVD ISO Image from a VIDEO_TS folder on MacOSX
/path/ is the root folder of the DVD, not the VIDEO_TS folder.

Shrink more than one blank lines to one in VIM.

Dump dvd from a different machine onto this one.
You can use this to directly dump from machine A (with dvd drive) to machine B (without dvd drive) . I used this to copy dvd using my friend's machine to my netbook. Above command is to be issued on machine B. Advantages : 1) No wasting time dumping first to machine A and then copying to Machine B. 2) You dont need to use space on Machine A. In fact, this will work even when Machine A doesnt have enough hdd space to dump the DVD. Use -C ssh option on slow networks (enables compression). you can replace "dd if=/dev/dvd" with any ripping command as long as it spews the iso to stdout.

Add "prefix" on a buch of files

Position the cursor under the current directory line
In case you're like me and like your commands to start on clean lines, especially when you're deep into a 10-level directory tree. This can be added to .bashrc.

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"

Suppress output of loud commands you don't want to hear from
Suppresses all output to /dev/null. This could be expanded to check for a -l command line option to log the stderr to a file maybe -l file or -l to log to default quietly.log. I'm finding that I use it more often than one would think.

The scene in the Shining (Stanley Kubrick)
Let's take a rest. How about watch a horror? The Shining http://en.wikipedia.org/wiki/The_Shining_(film)

Silently ensures that a FS is mounted on the given mount point (checks if it's OK, otherwise unmount, create dir and mount)
In my example, the mount point is /media/mpdr1 and the FS is /dev/sdd1 /mountpoint-path = /media/mpdr1 filesystem=/dev/sdd1 Why this command ? Well, in fact, with some external devices I used to face some issues : during data transfer from the device to the internal drive, some errors occurred and the device was unmounted and remounted again in a different folder. In such situations, the command mountpoint gave a positive result even if the FS wasn't properly mounted, that's why I added the df part. And if the device is not properly mounted, the command tries to unmount, to create the folder (if it exists already it will also work) and finally mount the FS on the given mount point.


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: