-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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s