mkdir: recursive alternative?

Verde Denim tdldev at
Thu Jul 17 19:21:10 UTC 2008

On Thu, Jul 17, 2008 at 2:56 PM, Robert Dailey <rcdailey at> wrote:

> Hi,
> I'm trying to use mkdir to create something like:
> /foo/blah/bar/something
> However, 'foo', 'blah', and 'bar' are not guaranteed to exist, so I
> need mkdir to recursively create the directories that are not there.
> Is there a way to do this? I did a lot of searching on google but I
> came up with nothing. Thanks.

if the path is known, something like
for $word in foo blah bar something
if [! -d $word]
   mkdir $word

(simple bash script)

> --
> ubuntu-users mailing list
> ubuntu-users at
> Modify settings or unsubscribe at:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ubuntu-users mailing list