- You can use 3 high-level S3 commands that are inclusive, exclusive and recursive.
- --include and --exclude are used to specify rules that filter the objects or files to be copied during the sync operation or if they have to be deleted
- Using recursive command on a file or directory, the command walks the directory tree including all the sub-directories
--exclude "*" --include "*.txt" \\\All files will be excluded from the command except for files ending with .txt
--include "*.txt" --exclude "*" \\\All files will be excluded from the comand
aws s3 cp /tmp/foo/ s3://bucketfiles/ --recursive --exclude "*" --include "*.jpg"
- Try the coded provided below:
aws s3 cp s3://personalfiles/ . --recursive --exclude "*" --include "file*”
Learn more about AWS by going through AWS course and master this trending technology.