Google Cloud Professional Cloud Developer — Question 13
You want to upload files from an on-premises virtual machine to Google Cloud Storage as part of a data migration. These files will be consumed by Cloud
DataProc Hadoop cluster in a GCP environment.
Which command should you use?
Answer options
- A. gsutil cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
- B. gcloud cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
- C. hadoop fs cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
- D. gcloud dataproc cp [LOCAL_OBJECT] gs://[DESTINATION_BUCKET_NAME]/
Correct answer: A
Explanation
The correct answer is A, as the 'gsutil cp' command is specifically designed for transferring files to and from Google Cloud Storage. Options B and D are incorrect because 'gcloud' commands do not support direct file uploads to Google Cloud Storage. Option C is also incorrect because 'hadoop fs cp' is used for copying files within Hadoop's file system, not for uploading to Google Cloud Storage.