情况描述:
① apt-get & yun install 命令 install 无法补全
② killall 后面自定义的进程名称无法补全。
1、安装bash-completion
sudo apt-get install bash-completion
&
yum install bash-completion
2、修改相关部分
2.1、修改bash
vim /etc/bash.bashrc
如果没有如下代码就添加 如果有请去掉注释
#enable bash completion in interactive shells
if ! shopt -oq posix; then
if [-f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion]; then
. /etc/bash_completion
fi
fi
2.2、重启
source /etc/bash_completion
2.3、修改bashrc
~/.bashrc
# enable programmable completion features (you don't need to enable
# this, if it's already enabled in /etc/bash.bashrc and /etc/profile
# sources /etc/bash.bashrc).
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
2.4、重启
source ~/.bashrc
2.5、成功