Skip to content

Instantly share code, notes, and snippets.

@mattsears
Created August 6, 2009 14:10
Show Gist options
  • Save mattsears/163328 to your computer and use it in GitHub Desktop.
Save mattsears/163328 to your computer and use it in GitHub Desktop.
# Bash Completions for SSH known_hosts and config hosts
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
complete -W "$(echo `cat ~/.ssh/config | cut -f1,2 -d ' ' | sed -e 's/Host[^s+]//g; s/^ *//; s/ *$//; /#.*/d' -e '/^$/d' | uniq`;)" ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment