Last updated: Feb 26, 2024
Reading time·2 min

To get the size of a folder in an S3 bucket, you have to:
Actions button and select Calculate total size.
Once you select the Calculate total size button you will be redirected to a
screen where the total size of the folder is shown.

To get the size of a folder in an S3 bucket using AWS CLI, run the s3 ls
command, pointing it to the folder's path and pass it the recursive,
human-readable and summarize parameters.
aws s3 ls s3://YOUR_BUCKET/YOUR_FOLDER/ --recursive --human-readable --summarize

The command's output shows:
$0.005 per 1,000 requests, where each request returns a maximum of 1,000 objects (us-east-1 region).1,000,000 objects, you would make 1,000 requests and the List operation would cost you $0.005.We specified the following parameters in the call to the s3 ls command:
| Name | Description |
|---|---|
| recursive | applies the s3 ls command to all files under the specified directory. |
| human-readable | displays the file sizes in a human-readable format. |
| summarize | displays the number of objects and total size of the files. |
You can learn more about the related topics by checking out the following tutorials: