AWS S3: how do I see how much disk space is using

前端 未结 18 1387
被撕碎了的回忆
被撕碎了的回忆 2020-12-12 10:33

I have AWS account. I\'m using S3 to store backups from different servers. The question is there any information in the AWS console about how much disk space is in use in my

18条回答
  •  没有蜡笔的小新
    2020-12-12 10:47

    The AWS CLI now supports the --query parameter which takes a JMESPath expressions.

    This means you can sum the size values given by list-objects using sum(Contents[].Size) and count like length(Contents[]).

    This can be be run using the official AWS CLI as below and was introduced in Feb 2014

     aws s3api list-objects --bucket BUCKETNAME --output json --query "[sum(Contents[].Size), length(Contents[])]"
    

提交回复
热议问题