[Solved] how to create multiple directory in one mkdir command

Hi, Unix Gurus,

  • I have a simple question, I need create multiple directory. I use
mkdir {dir1, dir2, dir3)

I got one directory as

{dir1, dir2, dir3}

I searched @ google, I got answer as above code.:wall::confused:

Anybody has any idea

Thanks in advance

---------- Post updated 05-11-11 at 09:26 AM ---------- Previous update was 05-10-11 at 10:31 PM ----------

Its is typo, don't put space between directory name.

mkdir {a,b,c}          right format

dont put

mkdir {a, b, c} 

Why complicate it when you can do...

mkdir dir1 dir2 dir3

unless there is constraints on the dirs.

Simple example:

mkdir -p /backup/{2008,2009,2010}/{01,02,03,04,05,06,07,08,09,10,11,12}/

A lot less typing.

Learnt something very nice today. Thanks people.