Home>Article>Operation and Maintenance> What is the command to create a directory in linux

What is the command to create a directory in linux

青灯夜游
青灯夜游 Original
2022-04-12 18:26:00 65933browse

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.

What is the command to create a directory in linux

#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] 目录名
  • -moption is used to manually configure the permissions of the created directory instead of using the default permissions.

  • -poption 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

What is the command to create a directory in linux

2. Use the mkdir command to create a directory. The command is followed by the directory name.

What is the command to create a directory in linux

You can use the ls command to view the newly created directory.

What is the command to create a directory in linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn