Reputation: 774
I am trying to get the project name of my GCP project. Firstly, I tried using the command:
gcloud projects describe $PROJECT_ID
Here you get the poject Id, number name, Organization and other details.
Then next use grep
command to get the project Name.
Upvotes: 2
Views: 5573
Reputation: 40061
It's often more convenient to use gcloud
only:
PROJECT=[[YOUR-PROJECT]]
gcloud projects describe ${PROJECT} \
--format="value(name)"
You may use e.g. value(projectNumber)
to get the project number.
Upvotes: 7
Reputation: 774
To get the project name of your GCP project, use the below command:
gcloud projects describe $PROJECT_ID | grep name | awk -F'name: ' '{print $2}'
where, $PROJECT_ID
is the id
of your GCP project
Upvotes: 1