如何获取gcloud的Shell命令完成(自动完成)? [英] How to get shell command completion (autocomplete) for gcloud?
问题描述
我尝试了以下两种方法:1.正式的
#清理:光盘..rm -f google-cloud-sdk-307.0.0-linux-x86_64.tar.gz
I tried both 1. the official Google installation for Ubuntu, and 2. the one-liner sudo snap install google-cloud-sdk --classic
, and neither didn't give me command autocompletion with tab. Has anyone found a version of installation that gives you autocomplete? I had it on my last laptop, so I know it's possible
ie. usage: gcloud compute instances li
(here you hit tab) and it autocompletes to gcloud compute instances list
Thanks!
I successfully installed gcloud's Command Line Interface with autocomplete here on February 24, 2021 at 7:00 P.M. EST (Eastern Standard Time). My operating system is Ubuntu 20.04
Shell commands copied from the aforementioned source:
sudo apt-get update
# You should probably do other commands after this like
# sudo apt-get upgrade, sudo apt-get dist-upgrade,
# but I didn't need them
# can cd wherever here:
cd
wget https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-307.0.0-linux-x86_64.tar.gz
tar –xvzf google-cloud-sdk-307.0.0-linux-x86_64.tar.gz
cd google-cloud-sdk
./install.sh
# Answer a few "y/N" questions, mostly to your preference.
# NOTE: Be sure to answer "Y" to the question "modify profile to update your $PATH and enable shell command completion?" !! (This was the crux of the OP's question)
# Clean up:
cd ..
rm -f google-cloud-sdk-307.0.0-linux-x86_64.tar.gz
这篇关于如何获取gcloud的Shell命令完成(自动完成)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!