Liunx Tab键不能自动补全【疑难杂症】

情况描述:

① apt-get & yun install 命令 install 无法补全
② killall 后面自定义的进程名称无法补全。

1、安装bash-completion

sudo apt-get install bash-completion
&
yum install bash-completion

2、修改相关部分

2.1、修改bash

vim /etc/bash.bashrc

如果没有如下代码就添加 如果有请去掉注释

 

#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


2.2、重启

source /etc/bash_completion

2.3、修改bashrc

~/.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

2.4、重启

source ~/.bashrc

2.5、成功

 

  • 3
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

PerryLes

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值