How can I use wildcards to `cp` a group of files with the AWS CLI

后端 未结 3 2090
执念已碎
执念已碎 2021-01-30 07:34

I\'m having trouble using * in the AWS CLI to select a subset of files from a certain bucket.

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

3条回答
  •  甜味超标
    2021-01-30 08:40

    Okay I have to say the example is wrong and should be corrected as follows:

    aws s3 cp . s3://data/ --recursive --exclude "*" --include "2006-08*" --exclude "*/*"
    

    The . needs to be right after the cp. The final --exclude is to make sure that nothing is picked up from any subdirectories that are picked up by the --recursive (learned that one by mistake...)

    This will work for anyone struggling with this by the time they got here.

提交回复
热议问题