Use the mkdir -p option, but note that it has a different effect.
-p Create intermediate directories as required. If this option is not specified, the full path prefix of each oper- and must already exist. On the other hand, with this option specified, no error will be reported if a directory given as an operand already exists. Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permission for the owner.
Andy Lester Sep 04 '13 at 20:13 2013-09-04 20:13
source share