To check the version information of the mkdir command run below command. To create directory and set permission at the time of creation, we use -m or -mode option with the mkdir command. $ mkdir -parent -verbose parent/childĪfter executing the above command, a new directory is created as well a child directory also created inside the parent directory. To create a parent directory and child directory using -p or -parents option and print a message that what is being done using -v or -verbose option along with the mkdir command in the Linux system as shown in below.
The mkdir command is also used to create multiple directories at time as shown in below. $ mkdir newdirĪfter executing this command, a new directory will be created with the “newdir” name in the current director. To create a new directory in the Linux/Unix operating system using terminal, we use mkdir (make directory) command as shown in below. It gives info about the version and then exits. No message prompt if existing and make parent directories as neededīy default, set the SELinux security context of each created directory
Set the mode of file as the time of directory creation just like the chmod command
The general syntax of the mkdir command is as follows − $ mkdir.īrief description of options available in the mkdir command. It is also used to create more than one directory at a time and set the permission for the directories just like the chmod command in the Linux system. The mkdir command is used to create a new directory in the Linux/Unix operating system.