How to download files from s3 bucket using command line

+2 votes
How to download a file from an s3 bucket using aws cli? Thank you!
Aug 23, 2019 in AWS by Greg
240,026 views

2 answers to this question.

+1 vote

You can use cp to copy the files from an s3 bucket to your local system. Use the following command:

$ aws s3 cp s3://bucket/folder/file.txt .

To know more about AWS S3 and its features in detail check this out! 

https://www.youtube.com/watch?v=XjPUyGKRjZs

You can even go through the AWS certification course to learn all about AWS S3, EC2, VPS, and more.

Hope this helps!

answered Aug 23, 2019 by Faiza
Hello, I am trying to use this command to copy. I get a "Permission denied" error. Any idea what to do?
Following command works but object is not seen in the system. Pl explain why
0 votes

Hi,

You can download files from an S3 bucket on your local system using the cp command. The following cp command copies a single object to a specified file locally.

$ aws s3 cp s3://mybucket/test.txt test2.txt

Get ready to level up your skills as an AWS Developer! Join our comprehensive AWS Developer Associate certification Course!

answered Dec 14, 2020 by MD
• 95,460 points
Thank you for this option