1
votes

Our bucket structure goes from MyBucket -> CustomerGUID(folder) -> [actual files]

I'm having a hell of a time trying to use the AWS CLI (on windows) --query option to try and locate a file across all of the customer folders. Can someone look at my --query and see what i'm doing wrong here? Or tell me the proper way to search for a specific file name?

This is an example of how i'm able to list ALL the files in the bucket LastModified by a date. I need to limit the output based on filename, and that is where i'm getting stuck. When I look at the individual files in S3, I can see other files have a "Key", is the Key the 'name' of the file? See Photo

aws s3 ls s3://mybucket --recursive --output text --query "Contents[?contains(LastModified) > '2018-12-8']"
1

1 Answers

1
votes

The aws s3 ls command only returns a text list of objects.

If you wish to use --query, then use: aws s3api list-objects

See: list-objects — AWS CLI Command Reference