Skip to content

Instantly share code, notes, and snippets.

@sleepyboy
Created November 28, 2012 00:49
Show Gist options
  • Select an option

  • Save sleepyboy/4158267 to your computer and use it in GitHub Desktop.

Select an option

Save sleepyboy/4158267 to your computer and use it in GitHub Desktop.
SSH hosts autocomplete
if [ -r ~/.ssh/known_hosts ]; then
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e 's/,.*//g' | uniq | grep -v "\["`;)" ssh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment