Medha Cloud Logo

How to Create Directories in CentOS?

In this post we will see how to create Directories in CentOS using terminal commands. CentOS is a Community Enterprise operating system which mainly focuses on the server. It is a part of Linux Operating System Distribution, and it is free to use.

Total Time Needed: 30 Minutes

Required Tools:

CentOS

Steps to create Directories in CentOS

Step 1 : 1. Create Single Directory
To create a single Directory:
The Command used to create a Single Directory is mkdir. Enter the Command mkdir along with Directory name, For example, to create a directory dir4 enter the Command mkdir dir4.

Check if the directory is created - Enter the command ls and press Enter. You can see that dir4 is created.

Step 2: Create Multiple Directories
Use the same command mkdir as above and type all the names of directories to be created. For example, to create directories dir5, dir6, dir7. Type mkdir dir5 dir6 dir7 and press enter

Check if the directories are created: -
Type the command ls and press Enter. You can see that dir5, dir6, dir7 are created

Step 3: Create a Directory at a Particular Location
To create a directory in a different location, type the command mkdir, and the path to the location. For example, to create a directory Dir8 in Desktop, the path to the desktop is /root/Desktop. Type mkdir /root/Desktop/ Dir8.

Step 4: Create Multiple Directories Inside Each Other.
To create a directory inside another directory which is not created yet use the command
mkdir –p . For example, to create a directory dire inside dird which is inside dire.
Type mkdir –p dirc/dird/dire and press enter

Conclusion:
Now you can create Directories in CentOS easily following these steps. However, if you have any doubts and need help to manage you Linux infrastructure please reach medha Hosting.
Read Here: How To Install CentOS On Virtual Machine?

Connect with Medha Cloud

Microsoft 365 Migration Form

I would like to send my contact information to MedhaCloud so that MedhaCloud can share additional information about products, services, thought leadership and invitations to flagship events with me by email. *

By submitting this form, I acknowledge that someone from MedhaCloud will contact me via email or phone to discuss my request.

Related Article

View All
chevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram