Here’s how to copy multiple files recursively using AWS CLI. The S3 cp command by default only copies a single file. To copy multiple files, you have to use the –recursive option along with –exclude and –include. In this example, we will exclude every file, but include only files with a json extension.

<pre lang="bash">
aws s3 cp /tmp/folder s3://bucket/folder \
  --exclude "*"
  --include "*.json"

The result:

<pre lang="bash">
upload: ./abc.json to s3://bucket/folder/abc.json    
upload: ./xyz.json to s3://bucket/folder/xyz.json