How to copy file while preserving directory structure using AWS command line


I have the following directory in my local computer:

What I want to do is to copy all the files with *.txt and preserving the subdirectory structure to Amazon S3 bucket. How can I do that?

At the end of the day in S3. We’d like to find this file and directory structure:

With standard Unix command I can do this:

But not sure how to do with with AWS command line.

In reality with have files with ~10Tb of size to transfer.


Just use sync:

Exclude include doc

Leave a Reply