install gcloud CLI code example
Example 1: ubuntu 20.04 install google cloud sdk
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
sudo apt-get update && sudo apt-get install google-cloud-sdk
Example 2: gcloud commands
gcloud init: Initialize, authorize, and configure the gcloud tool.
gcloud version: Display version and installed components.
gcloud components install: Install specific components.
gcloud components update: Update your Cloud SDK to the latest version.
gcloud config set project: Set a default Google Cloud project to work on.
gcloud info: Display current gcloud tool environment details.