Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ericjsilva
Created April 26, 2018 11:36
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 ericjsilva/7a513ef0937e9a1fa9fce9719617eb33 to your computer and use it in GitHub Desktop.
Save ericjsilva/7a513ef0937e9a1fa9fce9719617eb33 to your computer and use it in GitHub Desktop.
Determine size of AWS S3 Bucket

Determine size of S3 bucket

Below are AWS CLI commands that can be used for quickly determining the current size of an S3 bucket.

in MB

aws s3 ls s3://[bucket_name] --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024" MB"}'

in GB

aws s3 ls s3://[bucket_name] --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024" GB"}'

in TB

aws s3 ls s3://[bucket_name] --recursive | awk 'BEGIN {total=0}{total+=$3}END{print total/1024/1024/1024/1024" TB"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment