Creating Directories with mkdir

You might think of directories as being drawers in a file cabinet; each drawer contains a bunch of files that are somehow related. For example, you might have a couple of file drawers for your unread magazines, one for your to-do lists, and maybe a drawer for your work projects.

Similarly, directories in your Unix system act as containers for other directories and files; each subdirectory contains yet more related directories or files, and so on. You’ll probably create a new directory each time you start a project or have related files you want to store at a single location. You create new directories using the mkdir command, as shown in Code Listing 2.1.

Code Listing 2.1. Typing mkdir plus a directory name creates ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.