#instead of ls, use sync in dryrun mode aws s3 sync s3://bucket-name . --exclude "*" --include "folder*/*file*.txt" --dryrun # important