Created
April 5, 2020 04:33
-
-
Save stefanolaru/78d491973ff62ebf6ebb91e1a2c21f83 to your computer and use it in GitHub Desktop.
List S3 buckets size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for bucket in $(aws s3api list-buckets --query "Buckets[].Name" --output text); do echo $bucket | |
aws s3api list-objects --bucket $bucket --output json --query "[sum(Contents[].Size), length(Contents[])]"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment