How to copy an object to a folder in the bucket?

0 votes
I have created a cloud storage bucket. Now how do I copy an object to a folder in the bucket?
Oct 23, 2019 in GCP by Sam
• 5,330 points
82 views

1 answer to this question.

0 votes

Use the gsutil cp command to create a folder and copy the image into it:

gsutil cp gs://my-awesome-bucket/kitten.png gs://my-awesome-bucket/just-a-folder/kitten3.png

If successful, the command returns:

Copying gs://my-awesome-bucket/kitten.png [Content-Type=image/png]...
Copying     ...my-awesome-bucket/just-a-folder/kitten3.png: 164.3 KiB/164.3 KiB

You've just copied your object into a new folder in your bucket.

answered Oct 23, 2019 by Sirajul
• 50,440 points

Related Questions In GCP

0 votes
1 answer
0 votes
1 answer

How to change the storage class of objects within a bucket?

You could do this probably by overwriting the ...READ MORE

answered Oct 24, 2019 in GCP by Sirajul
• 50,440 points
71 views
0 votes
1 answer

How do I change the object storage class within a bucket using console?

No,Individual object storage classes cannot be set ...READ MORE

answered Oct 24, 2019 in GCP by Sirajul
• 50,440 points
59 views
0 votes
1 answer
0 votes
1 answer

GCP Error: 403: Access Denied

Check that your credentials are correct. For ...READ MORE

answered Oct 9, 2019 in GCP by Sirajul
• 50,440 points
155 views
0 votes
1 answer

Permissions issue with Google Cloud Storage Bucket.

You can regain access to the object by assigning an applicable role, like roles/storage.objectAdmin, to ...READ MORE

answered Oct 10, 2019 in GCP by Sirajul
• 50,440 points
475 views
0 votes
1 answer
0 votes
1 answer

How to create a cloud storage bucket in GCP?

Buckets are the basic containers that hold your ...READ MORE

answered Oct 23, 2019 in GCP by Sirajul
• 50,440 points
101 views