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

后端 未结 3 2055
执念已碎
执念已碎 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:39

    The Order of the Parameters Matters

    The exclude and include should be used in a specific order, We have to first exclude and then include. The viceversa of it will not be successful.

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

    This will fail because order of the parameters maters in this case. The include is excluded by the *

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

    This one will work because the we excluded everything but later we had included the specific directory.

提交回复
热议问题