-p option no error if existing, make parent directories as needed

commandline session

$mkdir 1
$pwd
/home/jeffrin/Test
$ls
1
$mkdir 2
$ls
1  2
$cd 2/
$mkdir -p hello/world
$ls
hello
$cd hello/
$ls
world
$cd world/
$ls
$pwd
/home/jeffrin/Test/2/hello/world
$cd -
/home/jeffrin/Test/2/hello
$pwd
/home/jeffrin/Test/2/hello
$ls
world
$

inner working

Leave a comment

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