How do I use aws s3 cp to download an entire folder from an S3 bucket

0 votes
I want to download an entire folder from my S3 bucket to my computer using the AWS CLI. How can I use the aws s3 cp command to do this? I just want to make sure that all the files in the folder are downloaded at once, not just one by one.
Oct 16 in AWS by Priyanka
• 4,080 points
92 views

1 answer to this question.

0 votes
  • Use the aws s3 cp command to copy files from or to an S3 bucket. Think of it like moving files between two different storage locations—S3 (cloud) and your computer.

  • command --> aws s3 cp s3://bucket-name/folder-path/ local-folder-path --recursive

  • This tells AWS to copy everything from the cloud folder to a local folder on your computer. 

 Let’s understand in detail: 

  • aws s3 cp: This means we are using the AWS CLI to copy files.

  • s3://bucket-name/folder-path/: This is the folder in S3 (your cloud storage) that you want to download.

  • local-folder-path: This is where you want to save the files on your computer.

  • --recursive: This ensures that all files and subfolders in the cloud folder are downloaded.

Example:

  • aws s3 cp s3://my-bucket-name/my-folder/ ./local-folder/ --recursive

  • This will download all the files from the folder named "my-folder" in S3 to a folder on your computer named "local-folder."

  • The recursive part is important because it makes sure you get everything inside the folder, not just the top-level files!

answered Oct 24 by Manuu

Related Questions In AWS

0 votes
0 answers
+3 votes
2 answers

How to download an entire bucket from S3 to local folder?

You can simply download your S3 bucket ...READ MORE

answered Dec 11, 2018 in AWS by Priyaj
• 58,020 points
11,900 views
0 votes
1 answer

How do I create folder under an Amazon S3 bucket through PHP API?

Of Course, it is possible to create ...READ MORE

answered Apr 24, 2018 in AWS by anonymous
11,408 views
0 votes
1 answer
+6 votes
14 answers

Python AWS Boto3: How do i read files from S3 Bucket?

You can use the following code, import boto3 s3 ...READ MORE

answered Dec 7, 2018 in AWS by Nitesh
315,604 views
0 votes
1 answer

AWS S3 uploading hidden files by default

versioning is enabled in your bucket. docs.aws.amazon.com/AmazonS3/latest/user-guide/….... the ...READ MORE

answered Oct 4, 2018 in AWS by Priyaj
• 58,020 points
5,963 views
–1 vote
1 answer

How to decrypt the encrypted S3 file using aws-encryption-cli --decrypt

Use command : aws s3 presign s3://mybucket/abc_count.png you get ...READ MORE

answered Oct 22, 2018 in AWS by Priyaj
• 58,020 points
5,210 views
0 votes
1 answer

Import my AWS credentials using python script

Using AWS Cli  Configure your IAM user then ...READ MORE

answered Nov 16, 2018 in AWS by Jino
• 5,820 points
2,873 views
0 votes
2 answers
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP