Get S3 Bucket Size


I did not realize that you can not find out the bucket size in the AWS console until some one asked me today. Here is a quick command to get the total size.

% for each in bucket1 bucket2; do echo -n $each; aws s3 ls --summarize --human-readable --recursive s3://$each | grep -i 'Total Size'; done
% bucket1   Total Size: 12.4 GiB
% bucket2   Total Size: 3.0 TiB

Leave a comment