What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again.

Delete that bloated snippets file you've been using and share your personal repository with the world. 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.

Get involved!

You can sign-in using OpenID credentials, or register a traditional username and password.

First-time OpenID users will be automatically assigned a username which can be changed after signing in.

Universal configuration monitoring and system of record for IT.

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:



May 19, 2015 - A Look At The New Commandlinefu
I've put together a short writeup on what kind of newness you can expect from the next iteration of clfu. Check it out here.
March 2, 2015 - New Management
I'm Jon, I'll be maintaining and improving clfu. Thanks to David for building such a great resource!

Top Tags



Psst. Open beta.

Wow, didn't really expect you to read this far down. The latest iteration of the site is in open beta. It's a gentle open beta-- not in prime-time just yet. It's being hosted over at UpGuard (link) and you are more than welcome to give it a shot. Couple things:

  • » The open beta is running a copy of the database that will not carry over to the final version. Don't post anything you don't mind losing.
  • » If you wish to use your user account, you will probably need to reset your password.
Your feedback is appreciated via the form on the beta page. Thanks! -Jon & CLFU Team

ssh autocomplete based on ~/.ssh/config

Terminal - ssh autocomplete based on ~/.ssh/config
perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config
2011-08-21 14:51:20
User: bashrc
Functions: perl
ssh autocomplete based on ~/.ssh/config

I use this in my bashrc to expand hosts defined in ~/.ssh/config:

function _ssh_completion() {

perl -ne 'print "$1 " if /^Host (.+)$/' ~/.ssh/config


complete -W "$(_ssh_completion)" ssh

Here's a great article on how to setup your own ~/.ssh/config:



There are 3 alternatives - vote for the best!

Terminal - Alternatives
complete -W "$(echo $(grep '^ssh ' .bash_history | sort -u | sed 's/^ssh //'))" ssh
2009-07-25 23:07:25
User: 0x89

Stop tormenting the poor animal cat. See http://sial.org/howto/shell/useless-cat/.



sort | uniq


sort -u
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
2009-07-23 15:59:55
User: viner

Add to your bash profile to minimize carpal tunnel syndrome.

Doesn't work with [email protected] but appending "-l user" works fine if needed.

Works for ping as well..

complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ping

complete -o default -o nospace -W "$(grep -i -e '^host ' ~/.ssh/config | awk '{print substr($0, index($0,$2))}' ORS=' ')" ssh scp sftp
2013-11-19 14:44:41
User: Wamith
Functions: scp ssh

I sue this in my .bashrc file

This will also do auto-completion for scp and sftp

complete -W "$(echo $(grep ^Host ~/.ssh/config | sed -e 's/Host //' | grep -v "\*"))" ssh
2014-09-20 19:16:24
User: nathancahill

Autocomplete from .ssh/config

complete -W "$(sed 's/;.*//;' /etc/hosts | awk ' /^[[:digit:]]/ {$1 = "";print tolower($0)}')" ssh
2011-06-20 03:54:45
User: daodennis

If you have a lot of hosts in /etc/hosts this would be very useful. Anyone have any more concise examples?

Know a better way?

If you can do better, submit your command here.

What others think

I would use a pattern like


(My config uses "Host=name")

Comment by dbbolton 282 weeks and 3 days ago

As everyone knows of which Mentor is always making brand-new handbags in various series. That is why, many instructor clients are happy to understand the completely new entrance involving mentor handbags in many different designs and styles. New coach bags come in a number of selections such as Poppy series, Kristine collection, Julia collection and many others. Listed below are the newest choices of new trainer handbags that you could take into account about:Coach Madison Collection .Madison variety would be the previous selection however some people enjoy the particular handbag kind of that series. That's the reason Mentor always makes along with changes the actual Madison series along with completely new arrival on the Coach handbags. Get to illustrate Trainer Madison Maggie, you'll find that bag in every time every yr. For the reason that from the design and style regarding Trainer Madison Maggie which might be usually basic and lovely. This specific bag is an ideal bag for ladies to cart in numerous instances. It really is very ideal carry handbags for any kind of women.Coach Julia Assortment .Julia collection would be the completely new Trainer bags series together with the kind of glenohumeral joint handbags. Fresh mentor Julia handbags are made of synthetic leather or trademark textile using the natural leather lean. They may be suitable for women who adore leather-based bags throughout shoulder or maybe hobo handbags fashion. You can get a Brand-new Julia Buckskin Make Bag for that major dimension you can also get Julia Article author Handle on top Tote with the little choice.Coach Poppy Selection .Because of the use of the particular Poppy variety, Private coach carries on generating great glamor form of mentor handbag in Poppy series. Coach Poppy handbags are incredibly multi-colored in addition to glamor while using fantastic form of coloration combo. You can obtain a Brand new Poppy Graffiti Fashion Tote to the huge sizing just one additionally, you can in addition take a Completely new Poppy Author Art work Cool Bag intended for various other use of small bag.Actually there are lots of additional brand new series available just like Mentor Charm series, Coach Beachfront assortment, Mentor Kristin assortment, and also Coach Peyton assortment. All those are generally previously mentioned just a couple example of the modern introduction regarding instructor handbags that you can imagine.You know you can always find great options to opt for if you wish to find fantastic handbags by Instructor. Consider the style http://www.hermesbeltsbirkinkellybag.co.uk/ current market presently, many women have become aficionado to discuss trainer totes as well as handbags. They will really like these individuals in addition to get all of them as the greatest developer handbag collection.

Comment by stephanieg915 2 days ago


Comment by sguerra376 1 day ago
























Comment by sguerra376 14 hours ago

Your point of view

You must be signed in to comment.