关于linux下用户不能使用tab补全处理
1.查看使用的shell
echo $SHELL
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。如果不是/bin/shell
查看 ls -l /bin/sh
如果该软连接的不是/bin/shell
执行 ln -sf /bin/bash /bin/sh
2.查看当前用户主目录下.bashrc
比如: vi /root/.bashrc
按shift+g 跳到最后一行
看一下语句是否被注释:
if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
. /etc/bash_completion
fi
如果注释了,则去掉注释
保存退出后 执行 source /root/.bashrc即可
该语句是起到什么作用呢,想想就知道 ,肯定是补全的功能,没错
bash-completion就是增强bash自动补齐功能
如果文件 /etc/bash_completion存在且。。。,就执行. /etc/bash_completion
原文:https://blog.csdn.net/dgj8300/article/details/51045797

更多精彩