SSH tab completion tip

MacOSXHints.com has a sweet little tip to get tab completion for ssh. Just enter the following line at the bottom of your .bash_profile script for tab completing goodness.

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

Perhaps the best part is that you can type ssh-[tab]-[tab] to quickly see all of the hosts that are in your known hosts file and then quickly pick out that IP or host name that you can never remember.

This entry was posted in Uncategorized and tagged . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>