Google Cloud Professional Cloud Developer — Question 135

You need to copy directory local-scripts and all of its contents from your local workstation to a Compute Engine virtual machine instance.
Which command should you use?

Answer options

Correct answer: C

Explanation

The correct answer is C, as the 'gcloud compute scp' command is specifically designed for securely copying files and directories to and from Google Cloud Compute Engine instances, with the '--recurse' flag allowing for the transfer of entire directories. Options A and B use 'gsutil', which is meant for Google Cloud Storage rather than Compute Engine instances, and option D uses 'gcloud compute mv', which moves files instead of copying them.