Bird
0
0

You want to copy a local file photo.jpg to an S3 bucket my-photos in a folder 2024/. Which command correctly does this?

hard📝 Best Practice Q15 of 15
AWS - CLI
You want to copy a local file photo.jpg to an S3 bucket my-photos in a folder 2024/. Which command correctly does this?
A<code>aws ec2 cp photo.jpg s3://my-photos/2024/</code>
B<code>aws s3 mv photo.jpg s3://my-photos/2024/</code>
C<code>aws s3 cp photo.jpg s3://my-photos/2024/</code>
D<code>aws s3 sync photo.jpg s3://my-photos/2024/</code>
Step-by-Step Solution
Solution:
  1. Step 1: Choose the correct AWS service and action

    Copying files to S3 uses aws s3 cp. EC2 commands do not handle S3 files.
  2. Step 2: Use the correct source and destination syntax

    Source is local file photo.jpg, destination is S3 path s3://my-photos/2024/.
  3. Final Answer:

    aws s3 cp photo.jpg s3://my-photos/2024/ -> Option C
  4. Quick Check:

    Copy local file to S3 = aws s3 cp [OK]
Quick Trick: Use 'aws s3 cp' to copy files to S3 buckets [OK]
Common Mistakes:
  • Using 'mv' which moves instead of copies
  • Using 'sync' for single file copy
  • Using EC2 commands for S3 file operations

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes