Create a new Cloud Storage bucket
gsutil mb gs://BUCKET_NAMEList all Cloud Storage buckets accessible in the current project
gsutil lsUpload a local file to a Cloud Storage bucket
gsutil cp FILE.TXT gs://BUCKET_NAME/Download a file from Cloud Storage to the current directory
gsutil cp gs://BUCKET_NAME/FILE.TXT .Delete an object from a Cloud Storage bucket
gsutil rm gs://BUCKET_NAME/FILE.TXTRename or move an object within Cloud Storage
gsutil mv gs://BUCKET_NAME/OLD.TXT gs://BUCKET_NAME/NEW.TXTRemove an empty Cloud Storage bucket
gsutil rb gs://BUCKET_NAMEPrint the contents of a Cloud Storage object to stdout
gsutil cat gs://BUCKET_NAME/FILE.TXTDisplay the total size of a Cloud Storage bucket in human-readable format
gsutil du -sh gs://BUCKET_NAMEDisplay metadata for a specific Cloud Storage object
gsutil stat gs://BUCKET_NAME/FILE.TXTRecursively upload an entire local directory to Cloud Storage
gsutil cp -r ./LOCAL_DIR/ gs://BUCKET_NAME/Synchronise a local directory with a Cloud Storage bucket, copying only changed files
gsutil rsync -r ./LOCAL_DIR gs://BUCKET_NAMEUpload a directory to Cloud Storage using parallel multi-threaded transfers
gsutil -m cp -r ./DATA/ gs://BUCKET_NAME/Enable object versioning on a Cloud Storage bucket
gsutil versioning set on gs://BUCKET_NAMEApply a lifecycle configuration file to a Cloud Storage bucket
gsutil lifecycle set lifecycle.json gs://BUCKET_NAMEGrant a user the Storage Object Viewer role on a Cloud Storage bucket
gsutil iam ch user:USER@example.com:roles/storage.objectViewer gs://BUCKET_NAMEApply a CORS configuration file to a Cloud Storage bucket
gsutil cors set cors.json gs://BUCKET_NAMEGenerate a signed URL valid for 1 hour for a private Cloud Storage object
gsutil signurl -d 1h KEY.json gs://BUCKET_NAME/PRIVATE_FILE.TXTSet a 365-day retention policy on a Cloud Storage bucket
gsutil retention set 365d gs://BUCKET_NAMECopy CSV files to Cloud Storage, skipping any files that already exist at the destination
gsutil cp -n ./DATA/*.csv gs://BUCKET_NAME/DATA/Ready to test yourself?
Practice these commands →