Does anyone have a way in the AWS CLI to get the very LAST object in a bucket by prefix
& LastModified
date?
I can't seem to find any documentation on how to achieve this.
I tried using the below command but it seems to be paginating by n
objects, reverse sorts, and outputs that 1 object but repeats for the next batch.
aws --output text s3api list-objects --bucket <bucket-name> --prefix <prefix> --query "reverse(sort_by(Contents,&LastModified))[:1]"