On my CentOS machine, I need to create a main directory inside which I will have a few sub directories and, inside them, some subsubdirectories.
Something like:
main_directory->sub1,sub2,sb3..
sub1->subsub1,subsub2,subsub3..
sub2->subsub1,subsub2,subsub3..
sub3->subsub1,subsub2,subsub3..
I want to create this kind of directory structure using a loop and using mkdir inside the loop. Also, I want the user to input all these directories and sub directories and sub sub directory names. How can I do this?
mkdir -p
works? an explanation of file globbing and brace expansion would be good too. then they could run something likemkdir -p main/sub{1,2,3}/subsub{1,2,3}
– cas May 27 '16 at 15:12