Issue
I’m new to shell scripting. I’m trying to create a main folder called Analysis. In the Analysis folder I would like four sub-folders named, PhenV1, PhenV2, HypV1, and HypV2. I then want to have each of those four sub-folders have another 2 folders named Genes and Variants and in each of the Genes and Variants folders to have two more folders named CNV and SNV. The directory structure is depicted by the image below. Here is what I’ve attempted
mkdir -p Analysis/PhenV1/{Genes/{CNV,SNV},Variants/{CNV,SNV},PhenV2/{Genes/{CNV,SNV},Variants/{CNV,SNV},HypV1/{Genes/{CNV,SNV},Variants/{CNV,SNV},HypV2/{Genes/{CNV,SNV},Variants/{CNV,SNV}}
This code only creates the parent folder Analysis, and subdirectories, PhenV1 and {Genes”m
Solution
mkdir -p Analysis/{PhenV1,Phenv2,HypV1,HypV2}/{Genes,Variants}/{CNV,SNV}
Creates:
$ tree
.
└── Analysis
├── HypV1
│ ├── Genes
│ │ ├── CNV
│ │ └── SNV
│ └── Variants
│ ├── CNV
│ └── SNV
├── HypV2
│ ├── Genes
│ │ ├── CNV
│ │ └── SNV
│ └── Variants
│ ├── CNV
│ └── SNV
├── PhenV1
│ ├── Genes
│ │ ├── CNV
│ │ └── SNV
│ └── Variants
│ ├── CNV
│ └── SNV
└── Phenv2
├── Genes
│ ├── CNV
│ └── SNV
└── Variants
├── CNV
└── SNV
29 directories, 0 files
Answered By – dan
This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0