Skip to content

Instantly share code, notes, and snippets.

View himanshu4141's full-sized avatar
:bowtie:

Himanshu yadav himanshu4141

:bowtie:
View GitHub Profile
@himanshu4141
himanshu4141 / Mac SSH Autocomplete
Created March 8, 2017 16:06 — forked from agaro1121/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;