How to download all the files in an AWS S3 Bucket?

Aram Koukia
Koukia
Published in
2 min readOct 14, 2021

--

Image from YouTube: https://www.youtube.com/watch?v=4phTbiG5Dgg

Unfortunately AWS S3 Console doesn’t have an option to download all the content of an S3 bucket at the moment, but there are other options like AWS CLI to do so.

First you need to install the CLI with one of the following commands:

sudo pip install awscli

or

sudo easy_install awscli

Once installed, you can then use the following command:

aws s3 sync s3://<your_source_s3_bucket> <your_local_path>

For instance:

aws s3 sync s3://all_my_stuff_bucket . 

This command will start downloading all the objects in all_my_stuff_bucket to the current directory.

The output will looks something like this:

download: s3://all_my_stuff_bucket/file1.txt to file1.txt
download: s3://all_my_stuff_bucket/file2.txt to file2.txt
download: s3://all_my_stuff_bucket/file3.txt to file3.txt

Notes:

  1. This will not touch or change anything in your S3 bucket.
  2. This will not delete anything in your destination folder.
  3. If you want to delete any existing files in your current folder you can include --delete argument.

--

--

Software Engineer, Engineering Leader and Manager @ AWS. Living my dream life. http://koukia.ca/