Linux (Ubuntu/Fedora/CentOS/RetHat) allows you to directly create folders and file directories on the GMONE and KDE interfaces. Of course, it is more convenient to directly use the mkdir command on the terminal, especially in folders and directories with Root permissions. Normal users cannot directly create folders and directories, in this case, you can use the mkdir command on the terminal to create the mkdir command. The following describes how to use the mkdir command.
I. mkdir command permission
All users can use the mkdir command on the terminal to create folders or directories in folders with permissions.
Ii. Format of the mkdir command
Format: mkdir [Option] DirName
Iii. mkdir command functions
The mkdir command can be used to create a folder or directory named by DirName at a specified position. To create a folder or directory, you must have the write permission on the parent folder of the created folder (Click here to learn about Linux File-Folder permissions ). In addition, the created folder (directory) cannot have the same name as the file name in its parent directory (that is, the parent folder), that is, the same directory cannot have the same name (case sensitive ).
Iv. mkdir Command Options
The [Options] in the Command generally have the following two types:
-M is used to set the access permission for the new directory. You can also use the chmod command to set the access permission.
-P is required to create an upper-level folder (or directory). If the folder (or directory) already exists, it is not considered as an error.
V. mkdir command example
Example 1: Create a folder named "it.dengchao.org" under/home/cc.
Run the following command.
Mkdir/home/cc/it.dengchao.org Example 2: Create a folder named "it.dengchao.org" under/home/cc/and grant permissions to the folder. The permission is 777.
Mkdir 777/home/cc/it.dengchao.org