Skip to content

Instantly share code, notes, and snippets.

@smaslennikov
Last active May 30, 2023 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smaslennikov/2c8a9c203db7ed57286f6e94b9f5a5be to your computer and use it in GitHub Desktop.
Save smaslennikov/2c8a9c203db7ed57286f6e94b9f5a5be to your computer and use it in GitHub Desktop.
find disks in all projects
#!bin/bash
for i in $(gcloud projects list | \
grep -v PROJECT_NUMBER | \
cut -d ' ' -f 1); do
gcloud config set project $i
gcloud compute disks list \
--filter="local-ssd" \
--uri | \
cut -d / -f 9
done | \
sort | \
uniq -c
Updated property [core/project].
Updated property [core/project].
1 northamerica-northeast2-a
1 us-central1-a
1 us-central1-f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment