1.打开/etc/bash.bashrc文件
vim /etc/bash.bashrc
2.去掉35-41行注释
34 # enable bash completion in interactive shells
35 if ! shopt -oq posix; then
36 if [ -f /usr/share/bash-completion/bash_completion ]; then
37 . /usr/share/bash-completion/bash_completion
38 elif [ -f /etc/bash_completion ]; then
39 . /etc/bash_completion
40 fi
41 fi
3.刷新配置文件
source /etc/bash.bashrc