Skip to content

Useful gcloud commands

Get projects

gcloud projects list

List organizations

gcloud organizations list --format="value(ID)"

List folders in GCP Org

gcloud resource-manager folders list --organization=$(gcloud organizations list --format="value(ID)")

Networking

How to get the uri

simply append --uri to get the URI

List Networks

gcloud compute network list --project=<>

List subnets

gcloud compute networks subnets list --project=<>

Enabled Services

Get all enabled service in a project

gcloud services list --enabled --project=<>

Get Just the name

gcloud services list --enabled --format="value(config.name)"
gcloud services list --format=json  | jq '.[].config.name' | tr -d '"'

Additional Reading


Want to make this site better? Open a PR or help fund hosting costs