Last Updated: August 09, 2016
·
261
· pilt

One-liner to get S3 bucket size

Bucket:

aws s3 ls --recursive s3://bucket/ |  awk '{ SUM += $3 } END { print SUM }'

Bucket and prefix/path:

aws s3 ls --recursive s3://bucket/prefix/ |  awk '{ SUM += $3 } END { print SUM }'