Linux command mkdir detailed explanation and example demonstration
In the Linux system, themkdir
command is used to create directories and is highly flexible and practical. sex. Through themkdir
command, users can quickly create a directory structure to facilitate management of files and data. This article will introduce the use of themkdir
command in detail and give specific code examples to demonstrate its functionality.
mkdir
Command introductionmkdir
is the abbreviation of "make directory" in English and is used to create a new directory. Its basic format is:
mkdir [option] directory name
mkdir
Common options for the command-m
: Specify the permissions for the new directory, the default is777
-p
: Create directories recursively, that is, you can create multi-layer directories at oncemkdir
Command example demonstrationmkdir mydir
The above command will create a directory named Is the new directory ofmydir
.
mkdir -p mydir1/mydir2/mydir3
The above command will recursively create themydir1
directory and recursively create it in itmydir2
directory, and then recursively create themydir3
directory inmydir2
.
mkdir -m 755 mydir
The above command will create a new directory with permissions755
mydir
.
mkdir dir1 dir2 dir3
The above command will createdir1
,dir2
,# at the same time ##dir3Three directories.
my directory, which can be passed Use single or double quotes to handle directory names with spaces.
mkdircommand. It can create directory structures quickly and easily, helping us better manage files and data. In daily Linux system management, the
mkdircommand is an essential tool. I hope this article will help you understand and master the
mkdircommand.
The above is the detailed content of Detailed explanation and example demonstration of Linux command mkdir. For more information, please follow other related articles on the PHP Chinese website!