December 15, 2010

How to create a path of directories

I've often times created a directory structure using a series of mkdir commands. For example,

mike@shiner $ mkdir foo
mike@shiner $ mkdir foo/bar
mike@shiner $ mkdir foo/bar/test

You can create the same directory structure as above by using the -p option.

mike@shiner $ mkdir -p foo/bar/test

No comments:

Post a Comment