Skip to content

Instantly share code, notes, and snippets.

@softberries
Created October 23, 2017 12:10
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 softberries/0b27f7bc9ef4db1bfa4680bd8e089dd6 to your computer and use it in GitHub Desktop.
Save softberries/0b27f7bc9ef4db1bfa4680bd8e089dd6 to your computer and use it in GitHub Desktop.
Command to get the size of the bucket

aws s3api list-objects --bucket YOUR_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