yum install -y bash-completion
source /usr/share/bash-completion/bash_completion
执行后yum拥有选项自动补全功能
对于docker-compose还需要安装(docker不需要):
curl -L https://raw.githubusercontent.com/docker/compose/1.22.0/contrib/completion/bash/docker-compose -o /etc/bash_completion.d/docker-compose
source /etc/bash_completion.d/docker-compose
k8s中kubectl指令的补全
source < (kubectl completion bash)
echo "source <(kubectl completion bash)" >> ~/.bashrc
git命令补全:
yum install git-extras gitflow -y
source /etc/bash_completion.d/*
或
wget -O /etc/bash_completion.d/git-completion.bash https://raw.githubusercontent.com/markgandolfo/git-bash-completion/master/git-completion.bash
. /etc/bash_completion.d/git-completion.bash