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

Show the UUID of a filesystem or partition
Shows the UUID of the given partition (here /dev/sda7). Doesn't need to be root.

See The MAN page for the last command
This works in bash. The "!!:0" limits the argument to man to be only the first word of the last command. "!!:1" would be the second, etc.

Day of the week of your birthday over the years.
Do you ever want to know which day of week was your birhday! Now you can check that with this command, just set your birh date at the beginning (My bday in the example) and the dates will be revealed. ;)

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

Route outbound SMTP connections through a addtional IP address rather than your primary

Set a posix shell to echo all commands that it's about to execute, after all expansions have been done.
the 'set -x' mode can be exited by typing $ set +x

vi a new file with execution mode
$ vix /tmp/script.sh Open a file directly with execution permission. Put the function in your .bashrc You can also put this in your vimrc: $ command XX w | set ar | silent exe "!chmod +x %" | redraw! and open a new file like this: $ vi +XX /tmp/script.sh

Quickly share code or text from vim to others.
Sprunge.us is a code/text sharing site like pastebin, but it is easy to post stuff from the command line. $ How it works: $ :w !command In vim, w writes the current tab to a file when a filename is given afterwards, but if !command is given, the output is piped to the stdin of command. $curl -F "sprunge=

Delete all but the latest 5 files, ignoring directories

Find the package that installed a 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: