Skip to content

Instantly share code, notes, and snippets.

@louisvernon
Created January 29, 2019 17:56
Show Gist options
  • Save louisvernon/52044fc7eb41c7bac7cf8426997fcdf4 to your computer and use it in GitHub Desktop.
Save louisvernon/52044fc7eb41c7bac7cf8426997fcdf4 to your computer and use it in GitHub Desktop.
Find a GCP Project from a GCS Bucket
bucket=gs://my-bucket
projectNumber=$(gsutil ls -L -b gs://${bucket#gs://} | grep -m1 "projectNumber" | tr -dc '0-9')
gcloud projects describe $projectNumber
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment