I need to grep a term over thousands of files in S3, and list those file names in some output file. I'm quite new using cli, so I've been testing both on my local, and in a small subset in s3.
So far I've got this:
aws s3 cp s3://mybucket/path/to/file.csv - | grep -iln searchterm > output.txt
The problem with this is with the hyphen. Since I'm copying over to standard output, the -l switch in grep returns (standard input) instead of file.csv
My desired output is
file.csv
Eventually, I'll need to iterate this over the whole bucket, and then all buckets, to get
file1.csv
file2.csv
file3.csv
But I need to get over this hurdle first. Thanks!