1、利用vi編輯器打開/etc/bash.bashrc文件(需要root權限)
Shell代碼 收藏代碼
sudo vi /etc/bash.bashrc
接下來會提示輸入密碼
2、找到文件中的下列代碼
Shell代碼
#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
3、最後 source一下 /etc/bash.bashrc即可, 即
Java代碼 收藏代碼
sudo source /etc/bash.bashrc
轉載至http://logicluo.iteye.com/blog/2145084,希望大家去博主那裏去。