Google Certified Associate Cloud Engineer 2020

Sign Up Free or Log In to participate!

is there a gsutil command to create a folder in a ‘bucket’ ?

is there a gsutil command to create a folder in a ‘bucket’ ? Did some research and i am not able to find one. Not sure if that is possible.Appreciate the response

1 Answers

Ah, you don’t need to! 🙂  You can just create an object into any folder structure you want!  Here’s a quote from Google’s "How Subdirectories Work" doc page:

gsutil provides the illusion of a hierarchical file tree atop the "flat" name space supported by the Cloud Storage service. To the service, the object gs://your-bucket/abc/def.txt is just an object that happens to have "/" characters in its name. There is no "abc" directory; just a single object with the given name.  

That said, you can also create a "folder" by ending an object name with a trailing "/".  And you’ll probably find all of that doc page I linked quite interesting. 🙂



Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?