How to download entire files from an S3 bucket?

In this blog, we are going to see how to download the entire files from the Amazon S3 bucket. If you are new to Amazon S3, then I recommend you to read this blog to get a high level understanding.

If you are using Amazon S3 then very often you will be downloading files from S3. There would be a situation for you to download the entire files and that is exactly what we will be seeing in this blog.

We will be using the CLI provided by amazon to interact with AWS services.

CLI installation

Go to the following link to download the CLI.

Select your operating system and follow the instructions provided.

Now confirm if the CLI has been installed using the following command.

Then configure the CLI using your AWS credentials as given below

So enough of the configurations and let’s jump to the actual command

aws s3 cp s3://WholeBucket LocalFolder --recursive

In case you want to exclude any files or folders you can use the following command

aws s3 cp s3://my-bucket-name ./local-folder --recursive --include "*" --exclude "excludeFolder/*" --exclude "excludeFolder/excludeFile.txt"

So this is how you can download using the CLI. If you want to download using a GUI then you can use the tool called Cyberduck.

Happy programming!!

Leave a Comment