Common examples:
Example one: Create a directory named Dir
Command: mkdir dir
Example two: Create multiple directories at the same time Dir1, Dir2, Dir3
Command: mkdir dir1 dir2 dir3
Example three: Create multiple directories recursively, such as to create a dir2 directory under/dir/dir1/
Command: mkdir-p /dir/dir1/dir2
Note: When you use the-P option, both directories are created when/dir and/dir/dir1 do not exist, indicating that recursive creation
Example four: Create a directory named Dir with permission 777
Command: mkdir-m 777 dir
Example five: Create the directory structure required for a project and display details when it is created
Command: MKDIR-PV 1/{2,3/{a,b},4/{c,d}}
Description: The meaning of this command is to create a directory in which there are directories 2, 3, 4, and A and B two directories in the 1/3 directory, with C and D 1/4 directories in two. If a project is to be done, you can first plan the corresponding directory and create
The details displayed are: mkdir: To create directory ' 1 '
mkdir: To create a directory ' a '
mkdir: To create directory ' 1/3 '
mkdir: To create directory ' 1/3/a '
mkdir: To create directory ' 1/3/b '
mkdir: To create a directory ' quarter '
mkdir: To create directory ' 1/4/c '
mkdir: To create directory ' 1/4/d '