系统相关
首页 > 系统相关> > Ubuntu设置tab自动补全

Ubuntu设置tab自动补全

作者:互联网

1.切换root用户,查看 /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

vi 文件删除对应代码注释

# 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

保存退出 :wq!

3.source 文件

source /etc/bash.bashrc

 

标签:completion,补全,share,etc,usr,tab,Ubuntu,fi,bash
来源: https://www.cnblogs.com/chencoolandclear/p/16464454.html