Forrest logo
back to the gsutil tool

gsutil:tldr:3559f

gsutil: Rename or move objects in a bucket.
$ gsutil mv gs://${bucket_name}/${old_object_name} gs://${bucket_name}/${new_object_name}
try on your machine

This command is using the "gsutil" tool, which is a command-line utility for interacting with Google Cloud Storage. It performs a "mv" operation, which stands for move/rename, on objects within a specified Google Cloud Storage (GCS) bucket.

Here's the breakdown of the command:

  • "gsutil" is the command used to execute the gsutil tool.
  • "mv" is the command option that specifies a move/rename operation.
  • "gs://${bucket_name}/${old_object_name}" represents the source object to be moved/renamed. It specifies the GCS bucket name using the variable "${bucket_name}" and the object name using the variable "${old_object_name}".
  • "gs://${bucket_name}/${new_object_name}" represents the destination where the object will be moved/renamed to. It also uses the variable "${bucket_name}" for the GCS bucket name and "${new_object_name}" for the new object name.

By executing this command, the object located at "gs://${bucket_name}/${old_object_name}" will be moved/renamed to "gs://${bucket_name}/${new_object_name}" within the same GCS bucket.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the gsutil tool