How to grep into files stored in S3

后端 未结 3 1210
北恋
北恋 2021-02-07 13:50

Do anybody know how to perform grep on S3 files with aws S3 directly into the bucket? For example I have FILE1.csv, FILE2.csv with many rows and want to look for the rows that

3条回答
  •  不思量自难忘°
    2021-02-07 14:42

    The aws s3 cp command can send output to stdout:

    aws s3 cp s3://mybucket/foo.csv - | grep 'JZZ'
    

    The dash (-) signals the command to send output to stdout.

    See: How to use AWS S3 CLI to dump files to stdout in BASH?

提交回复
热议问题