简体   繁体   中英

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?

使用awscli

aws s3 ls s3://bucket --recursive --human-readable --summarize
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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM