I love bash

Tab-complete ssh hostnames

How much time do you think you’d save if you could tab-complete the hostname every time you fired up ssh?

Put this in your .bash_profile:

SSH_COMPLETE=( $(cut -f1 -d' ' ~/.ssh/known_hosts |\
tr ',' '\n' |\
sort -u |\
grep -e '[:alpha:]') )
complete -o default -W "${SSH_COMPLETE[*]}" ssh

Enjoy 🙂