Created
July 30, 2020 16:55
-
-
Save colehocking/1994c6b9cb028e01cf77db16690e33b6 to your computer and use it in GitHub Desktop.
Get the S3 bucket size
This file contains hidden or 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
aws s3api --profile PROFILE_NAME list-objects --bucket BUCKET_NAME --output json --query "[sum(Contents[].Size), length(Contents[])]" | awk 'NR!=2 {print $0;next} NR==2 {print $0/1024/1024/1024" GB"}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment