g2thend

Linux

yum install -y bash-completion
source /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
echo "source <(kubectl completion bash)" >> ~/.bashrc


#添加kubectl的k别名
vim   ~/.bashrc 
alias k=\'kubectl\'
  
#tab命令只在使用完整的kubectl 命令起作用,使用别名k 时不起作用,修补:
 source <( kubectl completion bash | sed \'s/kubectl/k/g\' )  #写入 .bashrc 

mac

$ brew install bash-completion
$ source $(brew --prefix)/etc/bash_completion
$ source <(kubectl completion bash)

分类:

技术点:

相关文章:

  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-11-17
  • 2021-06-25
  • 2021-11-17
猜你喜欢
  • 2021-08-29
  • 2021-11-17
  • 2021-09-03
  • 2021-11-17
  • 2021-04-22
  • 2021-11-17
  • 2021-11-17
相关资源
相似解决方案