解决 Ubuntu 10.04 server 的Tab自动补全失效的方法

刚重装了一下 Ubuntu 10.04 server,发现使用TAB键自动补全的方法失效,在网上找了一下,终于找到解决方法

编辑/etc/bash.bashrc文件(必须以管理员权限),找到以下几行:

# enable bash completion in interactive shells
#if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
#    . /etc/bash_completion
#fi

把后三行前面的#去掉,取消注释,变为:

# enable bash completion in interactive shells
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
fi

然后重新打开终端窗口(或者重新登录),恢复正常。

posted @ 2011-03-02 00:16  Fakis  阅读(4198)  评论(0编辑  收藏  举报