tgp6zg
Last Updated: February 25, 2016
·
2.08K
· lixef
Cda26fb60fdb5950dd217c990c673a6c

OSX ssh config hostname autocompletion

If you're using a ssh config for storing your hostnames, OSX doesn't provide an auto completion.

Store this in your .bashprofile:
complete -o default -o nospace -W "$(/usr/bin/env ruby -ne 'puts $
.split(/[,\s]+/)[1..-1].reject{|host| host.match(/*|\?/)} if $_.match(/^\s*Host\s+/);' < $HOME/.ssh/config)" scp sftp ssh

source: http://hints.macworld.com/article.php?story=20100113142633883

Say Thanks
Respond
Filed Under