Autocomplete SSH SCP and SFTP
Don't ever again type whole hostname to connect to remote servers.
Just add this snippet to your ~/.bashrc
# Add tab completion for SSH hostnames based on ~/.ssh/known_hosts
[ -e "$HOME/.ssh/known_hosts" ] && complete -o "default" -o "nospace" -W "$(cut -f1 -d',' \
$HOME/.ssh/known_hosts | cut -f1 -d' ')" scp sftp ssh
Written by Gustavo Arjones
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ssh
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#