Command format
mkdir [OPTION] ... DIRECTORY...
Command parameters
-M,--mode=mode
Sets the mode of the file, similar to the chmod command.
-P,--parents
Creates an upper-level directory of the specified directory when needed, and is not treated as an error when the target directory already exists.
-V,--verbose
Information is displayed for each directory that is created.
-Z,--context=ctx
Set the SELinux security environment for each directory you create to CTX.
--help
Displays help information.
--version
Displays version information.
Instance
A) displays information when the catalog is created.
mkdir-v AAAmkdir:created directory ' AAA '
b) Set permissions when creating the directory.
mkdir-m A=RW BBB [[email protected] cmdline]$ ls-ltotal 8drwxrwxr-x 2 ucm ucm 4096 Oct 1 10:36 aaadrw-rw-rw-2 ucm ucm 4096 Oct 1 10:37 BBB
c) created automatically when the upper-level directory of the target directory does not exist.
MKDIR-VP ccc/xxxmkdir:created directory ' CCC ' mkdir:created directory ' ccc/xxx '
Linux Commands-mkdir: Creating a Directory