![](/img/trans.png)
[英]Where are the setup files or installed files on Kubernetes. Where are these installed on Linux or Google Cloud?
[英]Find out where Google Cloud SDK is installed
我需要在PATH
中添加 Google Cloud SDK。 所以我需要安装位置的路径。 是否有任何gcloud...
命令可以提供此信息?
如果不是,我必须通过which gcloud
等的符号链接 go。
这个问题有什么更清洁的解决方案吗?
以下命令将为您提供所需的信息:
$ gcloud info --format="value(installation.sdk_root)"
/path/to/google-cloud-sdk/
你需要追加/bin
。
您还有许多其他可用路径: config.paths.global_config_dir
, installation.sdk_root
等。 查看gcloud info --format=json
的输出,查询要查询的所有可用属性。
截至 2022 年 3 月,gcloud sdk链接表明您可以将 SDK 用于客户端库 Java、Python、Node.js、Ruby、.Net 和 88818789
此外,您也可以拥有 CLI。 如果您已安装 CLI,则(可选)安装过程的一部分是将 gcloud 二进制路径添加到您的 PATH,以便您可以找到它。
此脚本称为 path.bash.inc、path.zsh.inc 等,根据您的默认 shell 是什么,它将运行正确的 path.your_shell.inc 文件。 如果您从未运行过它,那么您的 gcloud 可能安装在您忘记的目录中。
如果是这种情况,那么您只需从根目录运行“查找”
查找/-name gcloud -type f -ls 2>/dev/zero
这与
2 AZ cli,在 Mac 上使用 homebrew 安装 - 在 /opt/homebrew/bin 路径下 - 如果你使用的是 Mac,它已经在你的路径中。
我用了:
dirname $(which gcloud)
并且工作就像一个魅力
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.