Had a web hosting client who wanted to find the offending large files that were costing them, so decided to check Amazon S3 bucket size and individual file size. Found out that the best way to do this was via the AWS Command Line interface, so downloaded it from here and used the instructions here to add the Access Key ID, Secret Access Key and Default Region to the AWS Command Line for secure connection.
Check Amazon S3 Bucket Size
- Open the standard Command Line then change directory by typing the following:
cd %ProgramFiles%\Amazon\AWSCLI\
- Type in the following to check file sizes on a whole bucket:
aws s3 ls –summarize –human-readable –recursive s3://[bucket-name]/
- Or type in the following to check file sizes on a particular directory:
aws s3 ls –summarize –human-readable –recursive s3://[bucket-name]/[directory]
This was a huge help to finding the large files and directories with a simple Check Amazon S3 Bucket Size command in the AWS Command Line. If your company is using Amazon AWS S3 Storage for cloud storage or need help getting the cloud storage setup, then contact us for assistance.