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

标签 bash ubuntu google-cloud-platform autocomplete ubuntu-20.04

两个我都试过了 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/

相关文章:

bash - 区分两个流(使用 fifo)直到一个结束——只适用于短流

bash - bash 文件模式和区分大小写的范围

node.js - 如何在 debian vagrant box 上安装 npm?

google-cloud-platform - 适用于 HTTP/HTTPS 的 GCE(Google 计算引擎),支持 IPv6,但不支持 SSL 卸载

linux - 使用移动窗口 bash 脚本的中值

linux - 尝试从文件满足目标条件的文件中删除以特定字符串开头的行,在 bash/linux 中

postgresql - 如何编写脚本来输入连接参数并从 Ubuntu 终端启动 OpenERP 服务器

ubuntu - PhpStorm,Ubuntu 16.04 中的透明窗口错误

google-compute-engine - 如何更改 Google Compute Engine 上的机器类型?

google-cloud-platform - 被谷歌云中的虚拟机锁定