shell - create main directory with folders inside and specific sub-folders -


in code below create main directory using the$date variable , create 5 folders in directory. can not seem figure out how create sub-folders in specific folders. thank :).

date=`date +%-m-%-d-%y`  mkdir -p /home/desktop/$date/{validation,file,test,count,base} 

structure example

6-1-2016 (`directory`) validation  file    test    count     base (`folders`) -1 -2                      -1 -2 -3   -1  (`sub-folders within folder`) 

update: below create directory date followed 5 folders in directory, 1 sub-folder in validation. however, can seem create 1 sub-folder , not multiple. thank :).

date=`date +%-m-%-d-%y`  mkdir -p /home/desktop/$date/{validation/1,file,test,count,base} 

file structure

6-1-2016 (`directory`) validation  file    test    count   base (`folders`) - 1                                      (`sub-folders within folder`) 

in case else has similar question, works:

date=`date +%-m-%-d-%y` mkdir -p /home/desktop/$date/{validation/{-1},file,test,count/{1,2,3},base/{1}} 

output (directory date folder sub-folder (within each specific folder)

6-2-2016 validation     file     test      count       base -1                               -1 -2 -3     -1 

Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo