Google Cloud Storage Command-line Utility [GSUTIL]
GSUTIL Command-line utility for Google Cloud Storage
Create Bucket (Including Storage Class, Location)
gsutil mb -c [storage class] -l [location] gs://bucket-name
gsutil rm -r gs://bucket-name
gsutil -m cp -r . gs://bucket-nameTurn on versioning on bucket (get details of versioning enable or not)
gsutil versioning get gs://bucket-nameSet versioning offgsutil versioning set off gs://bucket-nameEnable the versioninggsutil versioning set on gs://bucket-nameList all version of a filegsutil ls -a gs://bucket-nameLong listing format generation and meta-generationgsutil ls -al gs://bucket-nameChanges the storage class of a object in a bucket gsutil rewrite -s NEARLINE gs://bucket-name/*Change the storage class of multiple objects (Multi-Threading Parallel) gsutil -m rewrite -s NEARLINE gs://bucket-name/*Access Control List (ACL) on objects (Public access to the general public)gsutil acl ch -u AllUsers:R gs://bucket-name/filenameACL Remove the public access to the general public gsutil acl ch -d AllUsres gs://bucket-name/filenameRemoved the bucket and inside it's objectsgsutil -m rm -r gs://bucket-nameRemoved only objects inside a bucketgsutil -m rm -r gs://bucket-name/*Check the storage space of a bucket gsutil du -h gs://bucket-name gsutil help for commands gsutil [command] helpRsync within folders in bucket gsutil rsync [source-folder] [target-folder]Rsync from local folder to GCS bucket folder gsutil rsync [local-folder] gs://bucket-nameRsync deleted the contents in the target when deleted from the source gsutil -m rsync -r -d [local-folder] gs://bucket-name/Signed URL (Give access to a object for the specific time period)We need to create a service account for that and use the same json key for Sign URL -
gsutil signurl -d 10m -m GET [path-to-the-json-key] gs://bucket-name

 
 
