What command will create all of the needed directories in one step?

You need to create a simple hierarchy of directories: images/photos/summer/ottawa/
None of the directories on that path exists. What command will create all of the needed directories in one step?

You need to create a simple hierarchy of directories: images/photos/summer/ottawa/
None of the directories on that path exists. What command will create all of the needed directories in one step?

A.
mkdir -r images/photos/summer/ottawa/

B.
mkdir -R images/photos/summer/ottawa/

C.
mkdir -p images/photos/summer/ottawa/

D.
mkdir -P images/photos/summer/ottawa/

E.
mkdir -m images/photos/summer/ottawa/

Explanation:
From the man pages:
mkdir – make directories
-p, –parents make parent directories as needed



Leave a Reply 2

Your email address will not be published. Required fields are marked *


kavyashree

kavyashree

I think Answer is D. mkdir -P images/photos/summer/Ottawa/. Very firstly we need to create a parent directory and keep all these sub directories in it.

SyedJaved

SyedJaved

No C is correct with lower case p