1

I have done some research trying to find out if CLI has some build in support for file scanning and didn't succeed. Hence my question. Example: I have a file example.txt and it contains string 'hello world' but also is 2GB big. I don't want all the file contents but just want to find out if it contains 'hello world'. Is this feature supported? Something like:

aws s3 contains 'text' s3://my_bucket

And I would expect the list of files that contain 'text'.

Z.Szymon
  • 337
  • 1
  • 13

1 Answers1

0

The feature you want is not supported by AWS CLI. You will have to download all the files in your S3 bucket and use grep to filter the files containing the required text.

Suraj
  • 602
  • 3
  • 16
  • Yes, you'd have to build your own index in the general case, for example by indexing the files on their way into S3 using Elasticsearch or custom indexing in DynamoDB. If they are CSV or JSON files then S3 Select might suffice. – jarmod Sep 09 '19 at 14:51