Skip to content

Instantly share code, notes, and snippets.

@breenie
Last active January 27, 2020 11:07
Show Gist options
  • Save breenie/0df4bdebd0183f2a9c8bc66b03598885 to your computer and use it in GitHub Desktop.
Save breenie/0df4bdebd0183f2a9c8bc66b03598885 to your computer and use it in GitHub Desktop.
Get AWS S3 bucket usage
# Cribbed from https://serverfault.com/questions/84815/how-can-i-get-the-size-of-an-amazon-s3-bucket
aws s3api list-objects --bucket ${BUCKET} --output json --query "[sum(Contents[].Size), length(Contents[])]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment