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

tar the current directory wihtout the absolute path
tars the current directory (and its children) in an archive of the same name (plus ".tar" :)) in the parent directory without the absolute path, so that when the archive is extracted, only the current directory name is created for the path. Assumes bash/zsh.

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

A fun thing to do with ram is actually open it up and take a peek. This command will show you all the string (plain text) values in ram
cat? dd? RTFM

Geolocate a given IP address
Defines a function to geolocate a given IP address; if none supplied, will default to your external IP address.

Remove a range of lines from a file

Selecting a random file/folder of a folder
Also looks in subfolders

Preserve colors when piping tree to less

Lvextend logical volume
this command extends your logical volume. then it does a resize2fs on it as well. added the -r switch to make it launch resize.

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

Go to parent directory of filename edited in last command
Uses the last argument of the last executed command, and gets the directory name from it. Use $!:t for the filename alone, without the dirname.


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: