Skip to content

Instantly share code, notes, and snippets.

@balda
Last active August 29, 2015 13:55
Show Gist options
  • Save balda/8729686 to your computer and use it in GitHub Desktop.
Save balda/8729686 to your computer and use it in GitHub Desktop.
Alias ssh. Use it with `ssh [shortcut]`. Change `.bash_profile` for shortcuts autocompletion.
[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh
# contents of $HOME/.ssh/config
Host [shortcut]
HostName [www.example.com]
Port 22
User [username]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment