Skip to content

Instantly share code, notes, and snippets.

@jorgetovar
Created February 2, 2023 22:06
Show Gist options
  • Save jorgetovar/1f5e52ec4732d597e6d2bc432ee0745c to your computer and use it in GitHub Desktop.
Save jorgetovar/1f5e52ec4732d597e6d2bc432ee0745c to your computer and use it in GitHub Desktop.
for bucket_name in `aws s3 ls | awk '{print $3}'`; do
echo "$bucket_name"
aws s3 ls s3://$bucket_name --recursive --summarize | tail -n2
done
@petertwise
Copy link

Great, thank you!
I added --human-readable to get output like Total Size: 2.1 GiB instead of Total Size: 2282642431

@jorgetovar
Copy link
Author

That’s a good idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment