gsutil commands Flashcards
What command can you use to see the buckets in your current project?
gsutil ls
What is the command you could use to make a new bucket?
gsutil mb
What you make a new bucket using gsutil, what should the bucket name be preceded by?
gs://
What command would you use to get a JSON response of the lables in any particular bucket?
gsutil label get gs://
After redirecting the labels output of a bucket to a file, how can you use it to apply the same labels to a different bucket?
gsutil label set .json gs://
What is the command you would use to add additional labels to a bucket?
gsutil label set -l “key:value” gs://
What is the command you would use to see if versioning is turned on for a particular bucket?
gsutil versioning get gs://
What is the command you would use to set versioning on a particular bucket?
gsutil versioning set on gs://
What is the command you would use to copy an object from one bucket to another?
gsutil cp
What is the command you would run to see information about archived (versioning) objects within a bucket?
gsutil ls -a gs://
When viewing a versioned object in the command line, what is the name of the number that is appended to versioned (archived) objects?
This is a generation number
When you delete a versioned (archived) object, is it gone forever?
No, the file itself is gone, but the versioned object is still there an can be restored
What command would you run to copy all of the objects within a bucket to another bucket?
gsutil cp gs:///** gs://
What is the command you would run to remove a file from a bucket?
gsutil rm gs://bucket/or/file/name/
When you copy objects using the command line, are the sharing settings of that object also copied?
No, it depends on the bucket permissions