gsutil mv gs://my-bucket/old.txt gs://my-bucket/archive/old.txt

Category: Google Cloud & Workspace

gsutil mv gs://my-bucket/old.txt gs://my-bucket/archive/old.txt

Move or rename an object in a bucket

Renames or relocates old.txt within the bucket; moving between buckets also copies across locations and deletes the source. It performs a copy plus delete under the hood, so a failure mid-way can leave both copies. Use gsutil cp then gsutil rm when you need more control.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.