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 }'
Written by Simon Pantzare
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#