Sylvain
Sylvain

Reputation: 3070

Equivalent of "du" command on a Amazon S3 bucket

I'm looking for a solution to recursively get the size of all my folders on a Amazon S3 bucket which has a lot of embedded folders.

The perfect example is the Linux du --si command:

12M ./folder1
50M ./folder2
50M ./folder2/subfolder1
etc...

I'm also open to any graphical tool. Is there any command or AWS API for that?

Upvotes: 14

Views: 11258

Answers (2)

Bruno Gonzalez
Bruno Gonzalez

Reputation: 41

s3cmd du -H s3://bucket-name

This command tells you the size of the bucket (human readable). If you want to know the sizes of subfolders you can list the folders in the bucket (s3cmd ls s3://bucket-name) and then iterate through them.

Upvotes: 4

franklinsijo
franklinsijo

Reputation: 18270

Use awscli

aws s3 ls s3://bucket --recursive --human-readable --summarize

Upvotes: 21

Related Questions