Mac命令行Bash提示配置

Posted by 爱折腾的工程师 on Tuesday, March 12, 2019

brew安装bash-completion

brew install bash-completion

brew安装参考:https://brew.sh/

cat >> ~/.bashrc <<EOL
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
EOL

加载bash_completion提示

docker提示

cd $(brew --prefix)/etc/bash_completion.d

ln -s /Applications/Docker.app/Contents/Resources/etc/docker.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-machine.bash-completion
ln -s /Applications/Docker.app/Contents/Resources/etc/docker-compose.bash-completion

kubectl提示

kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl

helm提示

helm completion bash > $(brew --prefix)/etc/bash_completion.d/helm

istioctl提示

istioctl collateral completion --bash
mv istioctl.bash $(brew --prefix)/etc/bash_completion.d/

「真诚赞赏,手留余香」

爱折腾的工程师

真诚赞赏,手留余香

使用微信扫描二维码完成支付