gpt4 book ai didi

bash - 如何为 gcloud 获取 shell 命令完成(自动完成)?

转载 作者:行者123 更新时间:2023-12-04 18:39:04 33 4
gpt4 key购买 nike

两个我都试过了 1.官方Google installation for Ubuntu , 和 2. 单行 sudo snap install google-cloud-sdk --classic ,也没有给我命令自动补全选项卡。有没有人找到可以自动完成的安装版本?我在我的最后一台笔记本电脑上安装了它,所以我知道这是可能的
IE。用法:gcloud compute instances li (在这里你点击标签)它会自动完成到 gcloud compute instances list谢谢!

最佳答案

我成功安装了带有自动完成功能的 gcloud 命令行界面 here 2021 年 2 月 24 日晚上 7:00 EST(东部标准时间)。我的操作系统是 Ubuntu 20.04
从上述来源复制的 Shell 命令:

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)
This is an image description!  (Obviously this image shows a bash session with the question about autocompletion)
# Clean up:
cd ..
rm -f google-cloud-sdk-307.0.0-linux-x86_64.tar.gz

关于bash - 如何为 gcloud 获取 shell 命令完成(自动完成)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66360580/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com