Last active
January 2, 2016 13:59
-
-
Save mrmanc/8313720 to your computer and use it in GitHub Desktop.
This will allow you to tab complete any hostname you've previously ssh'd to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Taken from http://hints.macworld.com/article.php?story=20080317085050719 | |
Put the below line in your .profile, .bash_profile or .bashrc file (whichever you use). | |
If you don't know which file to put it in, read this explanation: | |
http://stackoverflow.com/questions/415403/whats-the-difference-between-bashrc-bash-profile-and-environment#answer-415444 | |
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment