Home > Article > Operation and Maintenance > What is the command to create a directory in linux
The Linux directory creation command is "mkdir". How to create a directory: 1. Execute the "cd directory name" command to switch to the parent directory; 2. In the parent directory, execute the "mkdir [-mp] directory name" command to create a new directory. The option "-m" is used to manually configure the permissions of the created directories, and "-p" is used to recursively create all directories.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
The command to create a directory in Linux is "mkdir".
The mkdir command is the abbreviation of make directories and is used to create new directories. This command can be used by all users.
The basic format of the mkdir command is:
mkdir [-mp] 目录名
-m
option is used to manually configure the permissions of the created directory instead of using the default permissions.
-p
option creates all directories recursively. Take creating /home/test/demo as an example. By default, you need to create them layer by layer. Each directory, and using the -p option, the system will automatically create /home, /home/test and /home/test/demo for you.
Steps to create a directory in Linux:
1. Use the cd command to switch to the parent directory
2. Use the mkdir command to create a directory. The command is followed by the directory name.
You can use the ls command to view the newly created directory.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What is the command to create a directory in linux. For more information, please follow other related articles on the PHP Chinese website!