Categories
Uncategorized

How to summarize file space usage on Amazon S3 using command line client

Use s3cmd Command Line S3 Client and Backup for Linux and Mac to display disk usage on a particular bucket.

Install s3cmd package.

$ sudo apt-get install s3cmd

Provide encryption options, access and secret keys.

$ s3cmd --configure

Display cumulative size of particular files on personal-bucket in bytes.

$ s3cmd du s3://personal-bucket/backup/safeguard-*
28361660 s3://personal-bucket/backup/safeguard-*

Display cumulative size of particular files on personal-bucket in human readable format.

$ s3cmd du -H s3://personal-bucket/backup/safeguard-*
27M s3://personal-bucket/backup/safeguard-*