Open marcobalk opened 10 years ago
This worked well for me, although I cleaned it up to match the existing tab completion:
[ -e "${HOME}/.ssh/known_hosts" ] && complete -o "default" -o "nospace" -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | cut -f 1 -d ':' | cut -f 1 -d ']' | cut -d '[' -f2`;)" scp sftp ssh;
Thanks! Nice one. Now using it in my fork.
Why not use
~/.ssh/knownhosts
for tab completion onssh
,scp
,sftp
. This way you have easier access to other hosts.I use the following command: