Create Directory From Brother Directory

212 views Asked by At

My directories have the following Format:
Inside the home directory, there are two directories: archive and production.

While inside the production directory I want to write a command to make a directory inside the archive directory.

Whats the best way to do this?

Thanks in advance

2

There are 2 answers

2
Ken White On BEST ANSWER

Use a relative path:

On Windows, from \home

 cd production
 mkdir ..\archive\newfolder

or md ..\archive\newfolder

On *nix, from /home

cd production
mkdir ../archive/newfolder

.. means parent (up one level), and the parent (one level up) from \home\production is \home

0
MiiinimalLogic On

from /home directory:

mdkir ../archive/$dirNameToMake