设置 docker & kubectl 命令行自动完成 (bas
2019-06-18 本文已影响0人
chenj23986526
- 安装 bash-completion
yum install -y bash-completion
source /usr/share/bash-completion/bash_completion
- 测试安装是否成功
type _init_completion
- 设置 docker completion
sudo curl -L https://raw.githubusercontent.com/docker/compose/1.24.0/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
- 设置 kubectl completion
echo 'source <(kubectl completion bash)' >>~/.bashrc
kubectl completion bash >/etc/bash_completion.d/kubectl
source ~/.bashrc