两种方式
1、安装bash-completion
yum install bash-completion
2、在 .bashrc 最后一行添加
complete -W "$(echo $(grep -v "HostName" ~/.ssh/config | grep Host | cut -d" " -f2 | sort -u | sed 's/^ssh //'))" ssh
source .bashrc
两种方式
1、安装bash-completion
yum install bash-completion
2、在 .bashrc 最后一行添加
complete -W "$(echo $(grep -v "HostName" ~/.ssh/config | grep Host | cut -d" " -f2 | sort -u | sed 's/^ssh //'))" ssh
source .bashrc