Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Directory Handling

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


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial