您的位置:首页 > 其它

Unbuntu 14.4安装之后就在终端中使用Tab键不能自动补全

2017-02-10 22:26 561 查看
Unbuntu 14.4安装之后就在终端中使用Tab键不能自动补全,解决办法如下:

 

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  

 将注释符号#去掉,即改成

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  

 3、最后 source一下 /etc/bash.bashrc即可, 即

Java代码  


sudo source /etc/bash.bashrc  

菜鸟张居然不知道如何退出vi编辑器

Esc+ :wq
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: