Linux Commands

How To Create a Directory in Linux

Directories, or folders, are organizational structures that help you organize your data and keep your Linux systems clean. They also streamline collaboration with other users on the same system.

Hence, directories become the most essential yet basic aspect for managing your systems efficiently. Creating and removing directories is a core operation, even for system administrators. However, many Linux newbies don’t know how to create new directories correctly. So, this quick tutorial explains the simple ways to create a directory in Linux. You can easily create the directories through the mkdir and File Manager. Let’s briefly take a look at both methods with suitable examples.

The mkdir Command

The sole operation of the mkdir is to create a directory, and you can use it by running the following command:

mkdir <options> directory_name

For instance, let’s create the media directory:

mkdir media


As you run the above command, it’ll create the media directory, and you can verify it using the ls command:


In case you want to print the output of the command, then you can use the -v option:

Mkdir -v linux


Moreover, if you want to create multiple directories, then all you need to do is add the name of those directories in the mkdir command:

mkdir -v windows android mac


You can also make a nested directory by using the -p option with the mkdir command:

mkdir -p parent_directory/sub_directory

Please replace parent_directory and sub_directory accordingly before running the command. So, let’s create the nested directory by including multiple files as the subdirectories:

mkdir -p Linux_OS/Ubuntu/Files

You can also verify the directory using the tree command:

cd ~/Linux_OS


The File Manager

Apart from using the terminal, you can opt fjyh  or the File Manager to create a directory in Linux. Linux distros come with an inbuilt file manager like Nautilus. For this method, go through the following steps:


Open the File Manager and navigate to the path where you want to create the new directory.


Now, right-click and then select “New Folder” from the Options menu. In some cases, the option may show as “Create Folder.”


Finally, enter your directory’s name and press Enter.

Wrapping Up

Creating directories in Linux is the most basic task, but many beginners still need to learn how to create one. This quick tutorial focussed on providing a step-by-step method for creating a directory using the mkdir command and the File Manager. We’d recommend using the mkdir command to build familiarity with the terminal.

About the author

Prateek Jangid