• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

GCP Projects List

March 26, 2020

Here’s how to get a list of GCP projects.

gcloud projects list

gcloud projects list

Result:

PROJECT_ID            NAME     PROJECT_NUMBER
your-project-id-xxxx  servers  xxxxxxxxxxxx

PROJECT_ID NAME PROJECT_NUMBER your-project-id-xxxx servers xxxxxxxxxxxx

Use awk to display the project id only.

gcloud projects list | awk '{print $1}'

gcloud projects list | awk '{print $1}'

Result

PROJECT ID
your-project-id-xxxx

PROJECT ID your-project-id-xxxx

Filed Under: Cloud Tagged With: awk, gcp, id, list, projects

Search This Website

Subscribe Via Email

  • Home
  • About
  • Archives

Copyright © 2023