ubuntu&Centos7设置tab自动补全

5 篇文章 0 订阅

解决方法

1、利用vi编辑器打开 /etc/bash.bashrc文件(需要root权限)

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 xxtab试一下



Centos7 自动补全包,安装:

yum -y install bash-completion

或者你可以安装一些初始化的包组

yum -y groupinstall Base Compatibility libraries Debugging Tools Dial-up Networking suppport Hardware monitoring utilities Performance Tools Development tools

退出ssh重新连接生效。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值