INTRODUCTION

How to create directory under Linux operating system using the bash shell or command prompt.
Use mkdir (make directory) command to make new directory in Linux and if you compare this command to MS windows operating system so almost similar command we use in in cmd to create folder which is: md.

SOLUTION

Now come back to Linux and see what is the syntax of mkdir command is:
The mkdir has the following Syntax:

`

$ mkdir [options] [directoryName]

Here are practical examples:

Run this following command to make the directory named dir0.

$ mkdir dir0

If you want to create multiple directories so you need to enter the following command:

 $ mkdir dir1 dir2 dir3 dir4 

Now list directory to see what is result.

$ ls
dir01  dir02  dir03  dir04

Tip:You can create multiple directories with this tricky command:

$ mkdir dir0{1,2,3,4}

Another example:

$ mkdir –p ~/websites/broexperts

We used -p option, it will allow you to create parent directory if it is not exist as above we create two directories one parent (websites) and child (broexperts).

Next: Create New File in Linux

If you have any question please leave comment and don’t forget to say thanks, as it’s free.:)


If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.

[thumbs-rating-buttons]


Similar Posts