in Education by
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. Essentially I'd like to replicate cat /path/to/files/* except for S3, e.g. s3cat '/bucket/path/to/files/*'. My first inclination looking at the options is to use the cp command to a temporary file and then cat that. Has anyone tried this or similar or is there already a command I'm not finding which does it? Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The contents of all the file objects have to be dumped to stdout Pass “-” for destination of aws s3 cp command to obtain this. For instance, $ aws s3 cp s3://mybucket/stream.txt What you're trying to do is something like this? :: #!/bin/bash BUCKET=your-bucket-name for key in `aws s3api list-objects --bucket $BUCKET --prefix bucket/path/to/files/ | jq -r '.Contents[].Key'` do echo $key aws s3 cp s3://$BUCKET/$key - | md5sum Done

Related questions

0 votes
    I'm having trouble using * in the AWS CLI to select a subset of files from a certain bucket. Adding * to the ... s3://data/2016-08*. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I'm trying to set up an Amazon Linux AMI(ami-f0091d91) and have a script that runs a copy command to copy ... what is going on? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Is it possible to get the ARN of an S3 bucket via the AWS command line? I have looked through the documentation ... way to do this. Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am using the aws cli to list the files in an s3 bucket using the following command (documentation): aws s3 ... only the file list? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am trying out a simple example suggested by AWS documentation to create a role using a policy json file http:// ... botocore/1.3.9 Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I created a new Access Key and configured that in the AWS CLI with aws configure. It created the .ini file in ~/ ... . How to fix this? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I want to list the public IP addresses of my EC2 instances using Bash, separated by a delimiter (space or ... something else entirely? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am thinking about redeploying my static website to Amazon S3. I need to automate the deployment so I was looking ... and AWS CLI? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I have a use case where I programmatically bring up an EC2 instance, copy and executable file from S3, run it and ... using the CLI ? Select the correct answer from above options...
asked Feb 8, 2022 in Education by JackTerrance
0 votes
    I tried to follow this tutorial. This is what I did in the console: pip3 install --user --upgrade awscli after ... 's the problem here? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    Looking for a quick way to pull my account number, I had originally thought of using aws iam get-account- ... cross-account origins? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I am following the AWS CLI Setup guide. I have managed to successfully install the tool on my Mac OS X ... could be going wrong? Select the correct answer from above options...
asked Jan 30, 2022 in Education by JackTerrance
0 votes
    I've got two different apps that I am hosting (well the second one is about to go up) on Amazon EC2. ... path ; ec2-describe-instances Select the correct answer from above options...
asked Feb 4, 2022 in Education by JackTerrance
0 votes
    Are there use cases that lend themselves better to Amazon cloudfront over s3 or the other way around? I'm ... 2 through examples. Select the correct answer from above options...
asked Feb 2, 2022 in Education by JackTerrance
0 votes
    I am unable to copy some files from a S3 bucket in AWS CLI Adding * to the path is not helping: ... /personalfiles/file* Please help Select the correct answer from above options...
asked Jan 24, 2022 in Education by JackTerrance
...