I am working on a Ruby tutorial and it is having set up projects using the listed command.

It is not quite clear to me what they are exactly doing with that command.

Are they making a path bin/lib/lib/NAME/test? The '/' is throwing me off maybe thinking that they are really just creating one lib folder?

thanks in advance


As my physics teacher used to say, "It's not as simple as it looks… it's simpler than that."

Command arguments – in both Linux and Windows – are space-delimited, and mkdir processes each one separately. So when you run mkdir bin lib lib/NAME test, it creates directories named after each argument, separately.

It is basically equivalent to:

mkdir bin
mkdir lib
mkdir lib/NAME
mkdir test

The syntax will be the same on Windows too, whether you create all four directories in one command or four commands – only the path separator differs (Windows uses lib\NAME).

| improve this answer | |

Spaces are seperators, so it creates the following directories:

  • bin
  • lib
  • lib/NAME (NAME being a subdirectory of lib)
  • test
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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