Bird
0
0

You want to upload all files from your local folder photos/ to the S3 bucket mybucket preserving folder structure. Which command should you use?

hard📝 Best Practice Q15 of 15
AWS - S3 Fundamentals
You want to upload all files from your local folder photos/ to the S3 bucket mybucket preserving folder structure. Which command should you use?
Aaws s3 sync photos/ s3://mybucket/
Baws s3 cp photos/ s3://mybucket/
Caws s3 cp photos/ s3://mybucket/ --no-recursive
Daws s3 mv photos/ s3://mybucket/ --recursive
Step-by-Step Solution
Solution:
  1. Step 1: Understand folder upload options

    To upload multiple files preserving folder structure, aws s3 sync is preferred as it copies all files and folders efficiently.
  2. Step 2: Compare commands

    aws s3 cp --recursive can copy folders but sync is better for syncing changes and preserving structure. mv moves files (deletes local), which may not be desired.
  3. Final Answer:

    aws s3 sync photos/ s3://mybucket/ -> Option A
  4. Quick Check:

    Use 'sync' to upload folders preserving structure [OK]
Quick Trick: Use 'aws s3 sync' for folder uploads preserving structure [OK]
Common Mistakes:
  • Using 'cp' without --recursive for folders
  • Using 'mv' which deletes local files
  • Forgetting to preserve folder structure

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes