linux

Linux command for create directory

Linux command for create directory :

To create a directory on linux use mkdir command.


Open your shell and type mkdir and your directory name.Use space between mkdir command and directory name.In linux the directory treat as folder.



The mkdir command can create multiple directories at once and it gives user the option to set permissions when creating the directory.


Example- Open Shell and type

                mkdir directoryname 


where the directory name provided by user





How to create multiple directories?

To create multiple directories in linux use mkdir and type your directories names.Note all directories must be separated by space.

Example-  Open shell and type

                 mkdir directory1 directory2 directory3










How to create parent directories?

You can make parent directories by using this following two methods

The first method is as follows :
mkdir directory1

cd directory1

mkdir directory2

cd directory2

mkdir directory3


where the cd command is for change directory


The second method is :

You can make parent folder by using single commands

Open shell and type

mkdir -p directory1/directory2/directory3

where -p is a flag






Sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *