Linux mkdir -p command is used to create multi-level directories, including non-existent parent directories. It has the advantages of simplifying directory creation, preventing errors and improving efficiency.
Linuxmkdir -p
Command: Create a multi-level directory
What Is it themkdir -p
command?
mkdir -p
is a Linux command used to create multi-level directories. Unlike the normalmkdir
command,mkdir -p
can recursively create non-existing parent directories.
Syntax
mkdir -p [选项] 目录
Options
-m Mode
: Set the permissions of the directory .-v
: Show detailed output, including directories created.-Z
: Sets the SELinux context for the directory.Function
mkdir -p
The command works in the following way:
Example
To create a multi-level directory using themkdir -p
command, use the following steps:
mkdir -p /home/user/Documents/NewFolder
This command will create a directory namedDocuments
in the/home/user
directory, and Create a directory namedNewFolder
within theDocuments
directory.
Advantages
The main advantages of using themkdir -p
command are:
The above is the detailed content of What does linux mkdir -p mean?. For more information, please follow other related articles on the PHP Chinese website!