linux poison RSS
linux poison Email

Making Directory tree with single command

Use mkdir with the `-p’ option to make a subdirectory and any of its parents that do not already exist. This is useful when you want to make a fairly complex directory tree from scratch, and don’t want to have to make each directory individually.

    * To make the `a/b/c’ directory — a subdirectory of the `b’ directory, which in turn is a subdirectory of the `a’ directory in the current directory, type:

      $ mkdir -p a/b/c [RET]

This makes a `c1′ subdirectory in the directory called `b’, which in turn is in a directory called `a’ in the current directory; if the `b’ or the `c’ directories do not already exist, they are made as well (if you know that `a’ and `b’ both exist, the above command works fine without the `-p’ option).


Post a Comment

Related Posts with Thumbnails