How To Use Aws S3 Cp Wildcards To Copy A Group Of Files In AWS CLI?

547    Asked by AlisonKelly in AWS , Asked on Nov 17, 2022

I am unable to copy some files from a S3 bucket in AWS CLI

Adding * to the path is not helping:

aws s3 cp s3://personalfiles/file* 

Don’t know how to use aws s3 cp wildcard. Please help

Answered by Amit raj

To download aws s3 cp multiple files from an aws bucket to your current directory, you can use recursive, exclude, and include flags. The order of the parameters matters.


Example command:

aws s3 cp s3://data/ . --recursive --exclude "*" --include "2016-08*"
For more info on how to use these filters: http://docs.aws.amazon.com/cli/latest/reference/s3/#use-of-exclude-and-include-filters

Your Answer

Interviews

Parent Categories