Create a New Directory and Any Necessary Subdirectories


mkdir -p

If you want to create a new subdirectory inside a new subdirectory inside a new subdirectory, this seems like a rather tedious task at first: create the first subdirectory, cd into that one, create the second subdirectory, cd into that one, and finally create the third subdirectory. Yuck. Fortunately, mkdir has a wonderful option that makes this whole process much more streamlined: -p (or --parents).

$ ls -l drwxr-xr-x   848 2005-10-19 11:36 src $ mkdir -p pictures/personal/family $ ls -l drwxr-xr-x    72 2005-10-20 00:12 pictures drwxr-xr-x   848 2005-10-19 11:36 src $ cd pictures $ ls -l drwxr-xr-x    72 2005-10-20 00:12   personal cd personal $ ls -l drwxr-xr-x    48 2005-10-20 00:12   family 




Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net