How to create a new directory in Linux

Where necessary, you may need to have access to a VPS server so you can follow how to implement the steps in this article.  You can get a cheaper VPS Server from Contabo with 4vCPU cores, 8GM RAM, and 32TB Bandwidth for less than $5.50 per month. Get this deal here now

Table of Contents

Cloud VPS S

$5.50 Monthly
  • 4 vCPU Cores | 8GB RAM


$15.50 Monthly
  • 6 vCPU Cores | 16GB RAM


$17.50 Monthly
  • 8 vCPU Cores | 24GB RAM

In the Linux operating system, creating a new directory is a fundamental task that every user should be familiar with. Whether you are a beginner or an experienced user, understanding how to create directories is essential for organizing your files and managing your system effectively. This article will guide you through the process with command examples.

Using the mkdir Command

The most common and straightforward way to create a new directory in Linux is by using the mkdir command. Open a terminal and follow the syntax below:

mkdir directory_name

Replace “directory_name” with the desired name for your new directory. For example, to create a directory named “Documents,” the command would be:

mkdir Documents

Creating Nested Directories

To create a directory within another directory, you can use the -p option with mkdir. This option ensures that any necessary parent directories are also created. Here’s an example:

mkdir -p Parent_Dir/Child_Dir

This command will create both “Parent_Dir” and “Child_Dir” if they don’t already exist.

Specifying the Path

You can create a directory in a specific location by providing the full path. For instance:

mkdir /path/to/directory

Replace “/path/to/directory” with the actual path where you want to create the new directory.

Creating Multiple Directories

To create multiple directories simultaneously, you can list them after the mkdir command. For example:

mkdir Dir1 Dir2 Dir3

This will create three directories named “Dir1,” “Dir2,” and “Dir3.”

Verifying Directory Creation

After executing the mkdir command, you might want to confirm that the directory has been created successfully. You can use the ls command to list the contents of the current directory:


This will display the names of the directories and files in the current location, allowing you to verify the creation of your new directory.

Adding file permissions to a directory

The chmod command is used to change file permissions in Linux. To add permissions to a directory, you can use the following syntax:

chmod permissions directory_name

Replace “permissions” with the specific permissions you want to add, and “directory_name” with the name of the directory. The permissions are represented by three digits (e.g., 755) or symbolic notation (e.g., u+rwx).

Numeric Representation of Permissions

The numeric representation of permissions consists of three digits, each representing a different user category:

  • Owner (u): The user who owns the directory.
  • Group (g): The group associated with the directory.
  • Others (o): Users who do not own the directory and are not part of the group.

Each digit is a combination of read (4), write (2), and execute (1) permissions. For example, to give the owner read, write, and execute permissions, and others read and execute permissions, you would use:

chmod 711 directory_name

Symbolic Notation for Permissions

Symbolic notation provides a more intuitive way to modify permissions. It uses letters to represent user categories and operators (+, -, =) to add, remove, or set permissions. For example:

chmod u+rwx,g+rx,o+r directory_name

This command gives the owner read, write, and execute permissions, the group read and execute permissions, and others read permissions.

Recursive Permission Setting

chmod -R permissions directory_name

This ensures that the specified permissions are applied not only to the directory itself but also to all files and subdirectories within it.

Verifying Permissions

To verify the permissions of a directory, you can use the ls command with the -l option. For example:

ls -l directory_name

This will display detailed information about the directory, including its permissions.

RECOMMENDED READING: How to add and edit file permissions in Linux

Hire us to handle what you want

Hire us through our Fiverr Profile and leave all the complicated & technical stuff to us. Here are some of the things we can do for you:

  • Website migration, troubleshooting, and maintenance.
  • Server & application deployment, scaling, troubleshooting, and maintenance
  • Deployment of Kubernetes, Docker, Cloudron, Ant Media, Apache, Nginx,  OpenVPN, cPanel, WHMCS, WordPress, and more
  • Everything you need on AWS, IBM Cloud, GCP, Azure, Oracle Cloud, Alibaba Cloud, Linode, Contabo, DigitalOcean, Ionos, Vultr, GoDaddy, HostGator, Namecheap, DreamHost, and more.

We will design, configure, deploy, or troubleshoot anything you want. Starting from $10, we will get your job done in the shortest time possible. Your payment is safe with Fiverr as we will only be paid once your project is completed.