Home >Operation and Maintenance >Linux Operation and Maintenance >How to create a directory under linux
The method to create a directory under Linux is: you can use the mkdir command to create it. The syntax of the mkdir command: [mkdir [-p] dirName], the parameter p means to determine whether the directory exists, and create it if it does not exist. Specific usage: [mkdir /usr/test].
The method to create a directory under Linux is: You can use the mkdir command.
(Recommended learning: linux tutorial)
mkdir syntax
mkdir [-p] dirName
Parameter description:
- p: Make sure the directory name exists. If it does not exist, create one.
Example:
Create a test directory in the /urs/ directory.
Enter the command: mkdir /usr/test, and the creation will be successful.
Example:
Create a subdirectory under the non-stub directory.
Create a test1_1 directory in the /urs/test1/ directory. /urs/test1 does not exist.
Enter the command: mkdir -p /usr/test1/test1_1, and the creation will be successful.
The above is the detailed content of How to create a directory under linux. For more information, please follow other related articles on the PHP Chinese website!