Claim your Biolink Click Here
2 like 0 dislike
32 views
AWS S3 BUCKET - download object or complete bucket to local computer
in Education & Reference by (730 points) | 32 views

1 Answer

0 like 0 dislike
sudo pip install awscli

aws configure 

Use the s3 cp command with the --recursive parameter to download an S3 folder to your local file system. The s3 cp command takes the S3 source folder and the destination directory as inputs and downloads the folder.

Create a folder on your local file system where you'd like to store the downloads from the bucket, open your terminal in that directory and run the s3 cp command.

Let's set the --dryrun parameter to run the command in test mode to verify everything looks good.

aws s3 cp s3://YOUR_BUCKET/YOUR_FOLDER . --recursive --dryrun

The output of the dry run command shows that everything works as expected.

Now let's run the s3 cp command in real mode to download the contents of the S3 folder to our local file system.

aws s3 cp s3://YOUR_BUCKET/YOUR_FOLDER . --recursive 

Replace the YOUR_BUCKET and YOUR_FOLDER placeholders with the bucket
and directory names.

We set the --recursive parameter in the command. It makes the s3 cp command applicable to all files under the specified directory.

The . character signifies that the destination of the downloads is the current directory.

by (1.4k points)

Related questions

3 like 0 dislike
0 answers
1 like 0 dislike
1 answer
0 like 0 dislike
0 answers
1 like 0 dislike
1 answer
1 like 0 dislike
1 answer
0 like 0 dislike
0 answers
3 like 0 dislike
1 answer
2 like 0 dislike
2 answers

Where your donation goes
Technology: We will utilize your donation for development, server maintenance and bandwidth management, etc for our site.

Employee and Projects: We have only 15 employees. They are involved in a wide sort of project works. Your valuable donation will definitely boost their work efficiency.

How can I earn points?
Awarded a Best Answer 10 points
Answer questions 10 points
Asking Question -20 points

1,268 questions
1,423 answers
568 comments
4,809 users