/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
去掉注释
#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
. /etc/bash.bashrc就ok了
本文转自神ge 51CTO博客,原文链接:http://blog.51cto.com/12218412/1885427