Thursday, August 23, 2012

Unix : Create multiple folder in a single command

Sometimes it becomes tedious to create multiple folders inside one folder and typing all those stuffs again and again make you bored or you get a feeling of machines :-)

So, here there is a easy way to fix this problem.
Suppose you wish to create the following structure :-

        Test                                     TestA                              work          logs
            |___ Test01                         |___ TestA01
            |___ Test02                         |___ TestA02
            |___ Test03                         |___ TestA03
            |___ Test04

Now, creating all these things in one go becomes easy by one of the simple unix command.

root> mkdir -p Test/{Test01,Test02,Test03,Test04} TestA/{TestA01,TestA02,TestA03} work logs
root> ls
Test  TestA  logs  work

Hope this helps and will make your work easy.

No comments:

Post a Comment