gsutil is the command line tool for Cloud Storage, included with the Google Cloud SDK. It covers the same everyday operations as the console, uploading, downloading, and copying files, but as a command you can run repeatedly, put in a script, or run from a machine that never opens a browser at all.
This walks through copying a file from your local machine into a bucket, pulling one back down, copying directly between two buckets, and then the part this guide is actually named for, removing a file for good.
gsutil cp LOCAL_FILE_PATH gs://BUCKET_NAME/

gsutil cp gs://BUCKET_NAME/FILE_NAME LOCAL_DESTINATION_PATH

Using cloud Shell

gsutil cp gs://SOURCE_BUCKET_NAME/FILE_NAME gs://DESTINATION_BUCKET_NAME/FILE_NAME

Using cloud shell

To delete a single object from a bucket:
gsutil rm gs://BUCKET_NAME/FILE_NAME
This deletes the object outright. gsutil itself gives no confirmation prompt before removing it, so double check the path before running this, especially with a wildcard.
To remove everything inside a folder like path without deleting the bucket itself:
gsutil rm gs://BUCKET_NAME/FOLDER_NAME/**
For a large number of objects, add the multi threading flag to speed the operation up:
gsutil -m rm gs://BUCKET_NAME/FOLDER_NAME/**
Adding -r instead recursively removes a folder like path and everything under it, and on a versioning enabled bucket, -r also removes every stored version of each object, not just the current one.
By default, Cloud Storage now keeps a deleted object in a recoverable, soft deleted state for a set number of days before it is gone for good, which can be restored with gcloud storage restore if you catch the mistake in time. This is a genuine safety net that did not always exist, but it is not unlimited, and it can be disabled on a bucket. If your bucket has soft delete turned off, gsutil rm is immediate and final, so treat it that way regardless.
That covers copying files in and out of a bucket with gsutil, and the delete command this page was always meant to include. To go further, explore Prwatech’s Google Cloud training program, which includes placement assistance.