命令补全
git命令补全
下载脚本
curl https://raw/branch.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
向 ~/.bashrc
写入以下内容
cat >> ~/.bashrc <<EOF
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
EOF
加载生效
source ~/.bashrc
k8s命令补全
安装包
yum -y install bash-completion
加载
source /usr/share/bash-completion/bash_completion
source <(kubectl completion bash)
向 ~/.bashrc
写入以下内容
echo "source <(kubectl completion bash)" >> ~/.bashrc