Home >System Tutorial >LINUX >What does linux mkdir -p mean?
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.
Linux mkdir -p
Command: Create a multi-level directory
What Is it the mkdir -p
command?
mkdir -p
is a Linux command used to create multi-level directories. Unlike the normal mkdir
command, mkdir -p
can recursively create non-existing parent directories.
Syntax
<code>mkdir -p [选项] 目录</code>
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 the mkdir -p
command, use the following steps:
<code>mkdir -p /home/user/Documents/NewFolder</code>
This command will create a directory named Documents
in the /home/user
directory, and Create a directory named NewFolder
within the Documents
directory.
Advantages
The main advantages of using the mkdir -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!