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
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s