An excercise in Distributed Memory Management. (aka I can't remember sh**).

ssh tab completion

One of the great things about OSX is the underlying unix environment. I regularly use terminal.app to ssh, ftp, and whatnot.

Today I stumbled upon this tip for adding tab completion to the ssh command – simply add the following to  your .bash_profile and now ssh can tab complete using the list of known hosts in your .ssh directory:

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

Thanks to macoxshints or the details :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Tag Cloud

Follow

Get every new post delivered to your Inbox.