Unix/Linux Go Back    


Shell Programming and Scripting Unix shell scripting - KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and shell scripts and shell scripting languages here.

how to create folder and sub-folder in UNIX ?

Shell Programming and Scripting


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 07-20-2009
suigion suigion is offline
Registered User
 
Join Date: Jul 2009
Last Activity: 10 September 2009, 11:37 PM EDT
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
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.


Code:
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 .. Linux

---------- 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.
Sponsored Links
    #2  
Old Unix and Linux 07-20-2009
ryandegreat25 ryandegreat25 is offline
Registered User
 
Join Date: Jul 2009
Last Activity: 27 November 2013, 3:15 AM EST
Posts: 286
Thanks: 16
Thanked 3 Times in 3 Posts
try


Code:
mkdir -p /home/batch/testing

Sponsored Links
    #3  
Old Unix and Linux 07-20-2009
suigion suigion is offline
Registered User
 
Join Date: Jul 2009
Last Activity: 10 September 2009, 11:37 PM EDT
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by ryandegreat25 View Post
try


Code:
mkdir -p /home/batch/testing

Hi,

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

-ISSUE SOLVED-
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
File Management: How do I move all JPGS in a folder structure to a single folder? guptaxpn Shell Programming and Scripting 4 06-11-2009 02:41 AM
How can I upload a zip folder on a unix path from my windows folder? ajit.yadav83 Windows & DOS: Issues & Discussions 2 01-29-2009 07:56 AM
Auto copy for files from folder to folder upon instant writing Bashar UNIX for Advanced & Expert Users 2 08-21-2008 02:44 PM
create folder in windows from unix while FTP Metalero de Oz UNIX for Dummies Questions & Answers 0 05-14-2008 01:22 PM



All times are GMT -4. The time now is 04:22 AM.