Tuesday, July 22, 2008

useful mkdir variant

You can actually make a whole path of directories with one single mkdir command:

mkdir -p a/b/c/d/e

will create a folder a, inside it folder b, ..., inside it folder e. If part of the path exists, it will not raise any error, it will simply create the part that does not yet exist.

To see how it proceeds, use:

mkdir -pv a/b/c/d/e

No comments: