Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
In Linux there are a few commands that work for both files and directories (such as the cp command), and some that only work for directories. To create a new directory, you'll need to use a specific command, which is covered in this section. Removing directories can get interesting, so that is covered in this section as well.
Creating Directories
There's not much to creating a new directory in Linux—just use the mkdir command:
$ mkdir dir3
$ ls -il
total 16
1954886 drwxr-xr-x 2 rich rich 4096 Sep 1 09:42 dir1/
1954889 drwxr-xr-x 2 rich rich 4096 Sep 1 10:55 dir2/
1954893 drwxr-xr-x 2 rich rich 4096 Sep 1 11:01 dir3/
1954888 -rw-r--r-- 1 rich rich 0 Dec 25 2011 test3
1954793 -rw-r--r-- 1 rich rich 6 Sep 1 09:51 test4