Mkdir


From Knoppix Documentation Wiki
Revision as of 16:40, 15 July 2008 by 204.13.14.5 (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

treltbaspas mkdir is the linux command used to create directories. You will hear directories referred to as folders.

mkdir knoppixtest

The above command line would be used to create a directory named knoppixtest.

mkdir -p knoppixtest/3.9

The mkdir has a useful argument other than the directory name. The parent directory option is very nice. You can create a directory and all of the parent directories above the last directory in the directory path list that is separated by the slash, /.

mkdir knoppixtest
mkdir knoppixtest/3.9

For example these two commands are the same as issuing mkdir -p knoppixtext/3.9.

mkdir -p /var/spool/mail

As the number of directories increases, then the create parent option becomes more valuable.

mkdir /var
cd var
mkdir spool
cd spool
mkdir mail
cd mail

Compare the above command sequence with

mkdir -p /var/spool/mail
cd /var/spool/mail

The parent option can save some time.