how to create folder and sub-folder in UNIX ?

Hi all,

I have the following code to check the whether the folder is exist in my system.

if [ -d /home/batch/testing ]; then echo 'folder exist'; else echo 'folder not exist'; mkdir /home/batch/testing ; fi

When I remove the "testing" folder from "/home/batch" directory, the code is working fine. But when I remove folder "/batch/testing" from "/home" directory, the code is not working. Actually I want to test whether the code is able to create directory "/batch/testing" in "/home" folder.

Anybody know how to do that?
thanks .. :slight_smile:

---------- Post updated at 11:03 PM ---------- Previous update was at 11:01 PM ----------

The error message I get is /home/batch: A file or directory in the path name does not exist.

try

mkdir -p /home/batch/testing

Hi,

It works!!... thanks a lot ^^

-ISSUE SOLVED-