Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to make multiple directories in one go. The problem is that one of the sub directories have a name with a space in it. The directory structure i want to make is as follows.

    /level 1

I tried escaping the space but it does not seem to work. Here is my command.

mkdir -p project/{level\ 1,level2}

But this does not seem to work. and results in directory structure like.



What am I doing wrong?

share|improve this question
Can you post your .bashrc, because nothing wrongs with your command. – favadi Dec 24 '12 at 5:32
Those cmds works for me – warl0ck Dec 24 '12 at 10:48
up vote 6 down vote accepted

You could trymkdir -p project/{'level 1','level 2'}

share|improve this answer
This would also work: mkdir -p project/level{' 1', 2} – laebshade Dec 24 '12 at 18:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.