Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find out where Google Cloud SDK is installed

Tags:

I need to add the Google Cloud SDK in the PATH. So I need the path to where is installed. Is there any gcloud ... command which gives me this information?

If not I have to go through the symlink in which gcloud, etc.

Any cleaner solution for this problem?

like image 774
4 revs, 2 users 76% Avatar asked Nov 25 '15 15:11

4 revs, 2 users 76%


People also ask

Where is Google Cloud SDK located?

Download and Install Google Cloud SDK On Windows: run the command . \google-cloud-sdk\install.

How do I know if Google Cloud SDK is installed?

The first thing to do after successful installation is open your command line and type “gcloud” to check whether Cloud SDK has installed perfectly. Run “gcloud init”, it opens up a new browser window and asks to login into your google cloud account.

Where is gcloud installed Windows?

Usually, this is C:\WINDOWS\system32; . If you uninstalled the gcloud CLI, you must reboot your system before installing the gcloud CLI again. If unzipping fails, run the installer as an administrator.


2 Answers

The following command will give you the information you're looking for:

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

You need to append /bin.

You also have lots of other paths available: config.paths.global_config_dir, installation.sdk_root, and so on. Look at the output of gcloud info --format=json for all available properties to query.

like image 118
Zachary Newman Avatar answered Nov 10 '22 00:11

Zachary Newman


I used:

dirname $(which gcloud) 

And worked like a charm

like image 36
EliuX Avatar answered Nov 10 '22 00:11

EliuX