首页 > 其他分享 >kubectl 补全报错:-bash: _get_comp_words_by_ref: command not found

kubectl 补全报错:-bash: _get_comp_words_by_ref: command not found

时间:2022-09-28 20:55:37浏览次数:68  
标签:completion kubectl 补全 command 报错 bash

1、kubectl自动补全设置

yum -y install bash-completion

source <(kubectl completion bash) # 在 bash 中设置当前 shell 的自动补全
echo "source <(kubectl completion bash)" >> ~/.bashrc # 在你的 bash shell 中永久地添加自动补全

2、在使用kubectl 自动补全报如下错误

  报错:-bash: _get_comp_words_by_ref: command not found

  解决方法:如果安装了bash-completion,还报上面的错误进行如下命令。

source /usr/share/bash-completion/bash_completion 

 

标签:completion,kubectl,补全,command,报错,bash
From: https://www.cnblogs.com/albert919/p/16677978.html

相关文章