Creating multiples levels of unix directories in one go



Often when creating databases (or doing any kind of installation on unix) multiple layers of directories may need to be created.

For example you may want /u01/oracle/product/10.2.0.5.0 created when currently the only part that exists is /u01.

Generally you might

cd /u01
mkdir oracle
cd oracle
mkdir .... etc

this is a bit painful when a lot of directories involved.

There is a shortcut however

mkdir -p /u01/oracle/product/10.2.0.5.0

creates the lowest level directory and any others above it that don't exist - a neat little time saver.

Comments