Title: Usage and examples of Linux command mkdir
In the Linux operating system, mkdir
is a commonly used command for creating new folders or directories. Through the mkdir
command, users can create a new directory structure at any location to facilitate management of files and data. This article will introduce the basic usage and examples of the mkdir
command to help readers better understand and master the use of this command.
mkdir
The basic syntax of the command is as follows:
mkdir [option] Directory name
Where, [Option]
is an optional parameter, Directory name
is the name of the new directory to be created.
-p
: Create a directory recursively, that is, if the superior directory of the directory to be created does not exist, the superior directory will be automatically created. -m
: Set the permission mode of the new directory. -v
: Display detailed information during the creation process. Assume that you are currently in the user's home directory and you want to create a directory named ## To create a new directory for #Documents, you can use the following command:
Documents will be created in the current directory. New directory.
project/notes under the
/home/user directory, you can Use the
-p option to recursively create multi-level directories:
/home/ Create a directory named project
under the user directory, and then create a subdirectory named
notes under the
project directory.
data under the current directory, and set the permissions to
rwxr-xr-x, you can use the
-m option:
data directory , and set its permissions to
rwxr-xr-x (755).
-v option. For example, create a new directory named
images and display detailed information:
images will be displayed Directory details.
mkdir command, and flexibly use this command to create and manage the directory structure according to actual needs. I hope this article can help readers become more proficient in using the
mkdir command in Linux systems.
The above is the detailed content of Usage and examples of Linux command mkdir. For more information, please follow other related articles on the PHP Chinese website!