Loading

开启 kubectl 命令的自动补全功能

步骤

安装:

# for centos
yum -y install bash-completion
# for ubuntu
apt install bash-completion

在文件 ~/.bashrc 中导入(source)补全脚本:

$ echo 'source <(kubectl completion bash)' >>~/.bashrc

退出当前会话:

$ logout

生效配置:

$ source ~/.bashrc

参考

Linux 系统中的 bash 自动补全功能 | Kubernetes
How To Fix "_get_comp_words_by_ref: command not found" | ComputingForGeeks

posted @ 2021-11-20 16:16  拾月凄辰  阅读(199)  评论(0编辑  收藏  举报