Skip to content

Instantly share code, notes, and snippets.

@wamith
Created April 18, 2019 05:26
Show Gist options
  • Save wamith/860396f0d330c8656e73ea22cfdd8951 to your computer and use it in GitHub Desktop.
Save wamith/860396f0d330c8656e73ea22cfdd8951 to your computer and use it in GitHub Desktop.
autocomplete for ssh and scp
# add this to .bashrc or .profile
# auto complete for ssh and scp
complete -o default -o nospace -W "$(grep -e 'Host[^N]' ~/.ssh/config | awk '{print substr($0, index($0,$2))}' ORS=' ')" scp sftp ssh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment