Recall & Review
beginner
What is the basic command to list all buckets in your Google Cloud Storage using gsutil?
The command is
gsutil ls. It lists all buckets in your current project.Click to reveal answer
beginner
How do you copy a file from your local machine to a Google Cloud Storage bucket using gsutil?
Use
gsutil cp [LOCAL_FILE_PATH] gs://[BUCKET_NAME]/. This uploads the file to the bucket.Click to reveal answer
beginner
What gsutil command removes a file from a bucket?
The command is
gsutil rm gs://[BUCKET_NAME]/[FILE_NAME]. It deletes the specified file from the bucket.Click to reveal answer
intermediate
How can you recursively copy all files from one bucket to another using gsutil?
Use
gsutil -m cp -r gs://[SOURCE_BUCKET]/** gs://[DESTINATION_BUCKET]/. The -m flag runs multiple operations in parallel for speed.Click to reveal answer
intermediate
What does the
gsutil rsync command do?It synchronizes the contents between a local directory and a bucket or between two buckets, copying only changed files to save time and bandwidth.
Click to reveal answer
Which gsutil command lists all files inside a specific bucket?
✗ Incorrect
The
gsutil ls gs://bucket-name/ command lists all files inside the specified bucket.How do you upload a file named 'photo.jpg' to a bucket called 'myphotos'?
✗ Incorrect
Use
gsutil cp photo.jpg gs://myphotos/ to upload the file.What flag allows gsutil to perform operations in parallel for faster copying?
✗ Incorrect
The
-m flag enables parallel (multi-threaded/multi-processing) operations.Which command deletes a file named 'old.txt' from a bucket 'mybucket'?
✗ Incorrect
The
gsutil rm command deletes files from buckets.What is the purpose of the
gsutil rsync command?✗ Incorrect
gsutil rsync synchronizes contents between locations efficiently.Explain how to upload multiple files from your local folder to a Google Cloud Storage bucket using gsutil.
Think about copying folders and speeding up uploads.
You got /4 concepts.
Describe the difference between gsutil cp and gsutil rsync commands.
One is for copying, the other for syncing.
You got /4 concepts.