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.