Bird
0
0

What is the result of executing this AWS CLI command?

medium📝 Predict Output Q5 of 15
AWS - CLI
What is the result of executing this AWS CLI command?
aws s3 cp myfolder s3://mybucket/ --recursive
AThe command fails because '--recursive' is invalid with 'cp'
BOnly the 'myfolder' directory itself is copied without contents
CAll files and subfolders inside 'myfolder' are copied to the S3 bucket
DOnly files directly inside 'myfolder' are copied, no subfolders
Step-by-Step Solution
Solution:
  1. Step 1: Understand the command

    'aws s3 cp' copies files or folders to S3.
  2. Step 2: Role of '--recursive'

    The '--recursive' flag copies all files and subdirectories recursively.
  3. Step 3: Expected behavior

    All contents inside 'myfolder' including subfolders are uploaded to the bucket.
  4. Final Answer:

    All files and subfolders inside 'myfolder' are copied to the S3 bucket -> Option C
  5. Quick Check:

    '--recursive' copies entire folder contents [OK]
Quick Trick: Use '--recursive' to copy folders and contents [OK]
Common Mistakes:
  • Thinking '--recursive' is invalid with 'cp'
  • Assuming only top-level files are copied
  • Expecting the folder itself to be copied as a single object

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes