Unbuntu 終端中使用Tab鍵不能自動補(bǔ)全,所以我們需要修改點(diǎn)東西來解決它
解決方法
1龙亲、利用vi編輯器打開 /etc/bash.bashrc文件(需要root權(quán)限)
sudo vi /etc/bash.bashrc
2清笨、找到文件中的下列代碼
#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、將注釋符號#去掉口糕,即改成
#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
4、最后 source一下 /etc/bash.bashrc即可稼钩, 即
sudo source /etc/bash.bashrc
使用
你可以apt-get install xx
加tab
試一下