bash_completion无法使用
查看是否安装bash_completion
没有安装则安装
shell
[root@localhost ~]# rpm -qa |grep bash-completion
bash-completion-2.1-8.el7.noarch查看/etc/bash_completion是否存在
[root@localhost ~]# ls /etc/bash_completion
ls: cannot access /etc/bash_completion: No such file or directory找到/etc/bash_completion位置
[root@localhost ~]# find / -name bash_completion
/usr/share/bash-completion/bash_completion将其复制到/etc下
shell
cp /usr/share/bash-completion/bash_completion /etc/修改/etc/profile文件,使其全局生效
echo "source /etc/bash_completion" >>/etc/profilerpm -q bash-completion && find / -name bash_completion |xargs -I file mv file /etc && echo "source /etc/bash_completion" >>/etc/profile |source /etc/bash_completion