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

后端 未结 5 842
谎友^
谎友^ 2020-12-24 04:16

I\'m starting a bash script which will take a path in S3 (as specified to the ls command) and dump the contents of all of the file objects to stdout. Essentiall

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 05:06

    If you are using a version of the AWS CLI that doesn't support copying to "-" you can also use /dev/stdout:

    $ aws s3 cp --quiet s3://mybucket/stream.txt /dev/stdout
    

    You also may want the --quiet flag to prevent a summary line like the following from being appended to your output:

    download: s3://mybucket/stream.txt to ../../dev/stdout

提交回复
热议问题