Skip to content

Instantly share code, notes, and snippets.

@ashirwad
Created June 10, 2024 20:35
Show Gist options
  • Save ashirwad/9b5e190e6a3b387c67c16cbeffbdcd1c to your computer and use it in GitHub Desktop.
Save ashirwad/9b5e190e6a3b387c67c16cbeffbdcd1c to your computer and use it in GitHub Desktop.
Copy or move multiple Google Cloud Storage files using gsutil

Move multiple files

gsutil ls gs://bucket-name/old-folder/file-naming-pattern | gsutil -m mv -I gs://bucket-name/new-folder/

Copy multiple files

gsutil ls gs://bucket-name/old-folder/file-naming-pattern | gsutil -m cp -I gs://bucket-name/new-folder/

Note: Check this doc to learn multiple approaches to specifying file naming patterns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment