Introduced:
This command creates the specified directory name, requires the user who created the directory to have write permissions in the current directory, and the specified directory name cannot be a directory that is already in the current directory
Grammar:
mkdir [-M] [-p] Directory name
Option Description:
-M: Set access permissions on the new directory or set with the chmod command;
-P: Can be a path name. In this case, if some directories in the path do not already exist, and with this option, the system will automatically establish those that do not already exist, that is, multiple directories can be established at one time;
Example of execution:
[[email protected] ~]$ mkdir dira[[email protected] ~]$ ls dira[[email protected] ~]$ mkdir-m 775 Dirb[[emai L protected] ~]$ ls-ldrwxr-xr-x 2 xxxx users 4096 Feb 22:29 diradrwxrwxr-x 2 xxxx users 4096 Feb 19 22:30 Dirb[[email protected] ~]$ mkdir-p dirc/hello[[email protected] ~]$ ls-ldrwxr-xr-x 2 xxxx users 4096 Feb 19 22:29 diradrwxrwxr-x 2 xxxx users 4096 Feb 22:30 dirbdrwxr-xr-x 3 xxxx users 4096 Feb 22:31 Dirc[[email Pro tected] ~]$ ls Dirchello
mkdir- p /usr/local/apache
Linux mkdir Create Folder command