Creating Directories

Learn how to create directories using the CLI.

Using the mkdir command

Directories help us organize our files and projects. The mkdir command lets us create a directory. Let’s use it to create a directory called “website” in the root directory. At the prompt, assuming we’re still in your root directory, type the following:

$ mkdir website

The ls command

If the computer’s graphical desktop is visible, and we create the directory in the home directory, we see the directory appear. Otherwise, use the ls command to view it:

$ ls

The cd command

Once we’ve created the directory, we can use the cd command to navigate into that directory:

$ cd website

By running the terminal below, we can see the effect of these commands.

Get hands-on with 1200+ tech skills courses.