How list Amazon S3 bucket contents by modified date?

后端 未结 8 1278
[愿得一人]
[愿得一人] 2020-12-14 06:30

Most of the time it happens that we load files in a common S3 bucket due to which it becomes hard to figure out data in it.

How can I view objects uploaded on a part

8条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 07:02

    Search on a given date

    aws s3api list-objects-v2 --bucket BUCKET_NAME --query 'Contents[?contains(LastModified, `YYYY-MM-DD`)].Key'
    

    Search from a certain date to today

    aws s3api list-objects-v2 --bucket BUCKET_NAME  --query 'Contents[?LastModified>=`YYYY-MM-DD`].Key'
    

    You can optionally remove the .Key from the end of the query to grab all metadata fields from the s3 objects

提交回复
热议问题