//View Tip #312
Similar Tips
» List user accounts on a system
» Remove or delete columns from a csv file
» Mass-renaming files
» Command line currency conversion
» My code is compiling

 

Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
SSH_COMPLETE=( $(cat ~/.ssh/known_hosts | \
                 cut -f 1 -d ' ' | \
                 sed -e s/,.*//g | \
                 uniq | \
                 egrep -v [0123456789]) )
complete -o default -W "${SSH_COMPLETE[*]}" ssh


View Comments »




Comments 

Add your comment

Comments are currently disabled
jerbear
This will not work on most systems as the known_hosts file is now stored in such a way that you can not get hostnames from it.
Posted 2008-09-17 13:56:45

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit