了解Google Cloud SDK的安装位置

时间:2015-11-25 15:34:03

标签: bash google-cloud-platform gcloud gcloud-cli

我需要在PATH中添加Google Cloud SDK。所以我需要安装到哪里的路径。是否有gcloud ...命令给我这个信息?

如果不是,我必须通过which gcloud等中的符号链接

针对此问题的任何清洁解决方案?

2 个答案:

答案 0 :(得分:30)

以下命令将为您提供您正在寻找的信息:

$ gcloud info --format="value(installation.sdk_root)"
/path/to/google-cloud-sdk/

您需要附加/bin

您还有许多其他路径可用:config.paths.global_config_dirinstallation.sdk_root等。查看gcloud info --format=json的输出,查询要查询的所有可用属性。

答案 1 :(得分:1)

我用过:

dirname $(which gcloud)

像魅力一样工作

相关问题