安装自动补齐需要依赖工具
yum install -y bash-completion
docker命令补齐:
执行下列命令
sh /usr/share/bash-completion/bash_completion
sh /usr/share/bash-completion/completions/docker
kubectl命令补齐:
sh /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
echo "source <(kubectl completion bash)" >> ~/.bashrc
#或者
echo "source <(kubectl completion bash)" >> /etc/profile
来源:oschina
链接:https://my.oschina.net/u/4305979/blog/4429323