Assume that you want to create nested directories in Unix with one command. You can achieve this by adding the -p
after the mkdir
and then by specifying the path.
Let’s say that I want to create a directory “my_pictures” and then inside this folder to add another directory called my “my_wedding”. We can achieve that simply by typing:
mkdir -p my_pictures/my_wedding
We can confirm that the two folders have been created as expected by typing:
tree .
.
└── my_pictures
└── my_wedding