How to create dirs recursively ?

To create directories recursively, we need to specify -p flag for mkdir command:

mkdir -p root/child1/child2

If any of these directories exists, this command will create 3 directories: root, child1 and child2.