In linux, the command for creating folders (directories) is mkdir. The mkdir command can create folders (directories) and set the permissions for folders (directories) at the same time, the following describes how to use mkdir and provides an example.
Syntax:
Mkdir
[-P]-p or -- parents indicates that if the upper-level directory of the directory to be created is not created, the upper-level directory will be created together.
[-- Help]
[-- Version]
[-M <Directory attribute>] [directory name]-m <Directory attribute> or -- mode <Directory attribute> indicates that the directory permission is set when the directory is created.
Example:
Mkdir aaa create the aaa directory in the current directory
Mkdir-p/home/www/aaa create aaa directory. If the home/www directory path does not exist
Mkdir-m 777 aaa create the aaa directory in the current directory and set it to readable, writable, and executable.
Note: If you are prompted that you do not have the permission to create an instance, use the sudo command to escalate the permission and create the instance.
Articles you may be interested in
- Delete files in linux. Detailed explanation of the rm command for folder commands
- Linux File Creation (touch) command details
- Linux chmod (file or folder permission setting) command parameters and Usage Details
- How many lines of files can be viewed in linux?
- Linux File Content statistics command wc command usage details
- Summary of linux Command for viewing File Content
- Prohibit web page right-click, copy, save as, View Source file and other functions to implement web page source code protection
- Use SecureCRT to upload and download files (using sz and rz commands)