How do I use wildcards to copy group of files in AWS CLI

946    Asked by JuliaGraham in AWS , Asked on Jul 27, 2021

For some reason, I am having trouble using * in AWS CLI to copy a group of files from a S3 bucket.

Adding * to the path like this does not seem to work

aws s3 cp s3://myfiles/file*

How to use aws s3 cp wildcards to copy group of files in AWS CLI? Any suggestions?


Answered by Emily Coleman

If you want to download multiple files from an aws bucket to your current directory, you can use recursive, exclude, and include flags like this:

        aws s3 cp s3://myfiles/ . --recursive --exclude "*" --include "file*"`

This way you can use AWS s3 cp wildcard to copy the group of files in

AWS CLI.

Your Answer

Interviews

Parent Categories