ubuntu中使用tab键来补齐输入命令普通用户可用切换root后不能的解决方法

Posted by admin on 2013, July 6

在终端输入即可,注意.和/之间的空格

. /etc/bash_completion

这样就可以了,但是重启又不行,找到root的配置文件修改即可

找到 /root/.bashrc文件进行编辑,最后的三行

enable programmable completion features (you don’t need to enable

this, if it’s already enabled in /etc/bash.bashrc and /etc/profile

sources /etc/bash.bashrc).

if [ -f /etc/bash_completion ] && ! shopt -oq posix; then

. /etc/bash_completion

fi

注释掉如上即可,exit退出再来就可以了