7.6 "Linux learning is not difficult" file/directory Management (6): mkdir command to create a directory
Use the mkdir command to create a directory on a Linux system.
Command syntax:
mkdir [Options] [contents]
The meanings of the options in the command are as shown in the table.
Options |
option meaning |
-m < permissions mode > |
set permissions on the newly created directory, when the-m option is not available, the default permission is 755 |
-P |
can be a path name. At this point, if some directories in the path do not already exist, and with this option, the system will automatically create directories that do not already exist, that is, multiple directories can be established at one time |
Example: Create a directory Newdir1 with default permissions of 755.
[Email protected] ~]# mkdir Newdir1
Example: Create a directory Newdir2 with permissions of 777.
[Email protected] ~]# mkdir-m 777 Newdir2
This article extracts from "Linux Learning is not difficult" textbook, which is one of the most practical, theoretical and practical Linux Introductory materials. To read the entire book, visit the Linux ops (www.linuxywz.com) website .
"Linux learning is not difficult" file/directory Management (6): mkdir command to create a directory