Home > System Tutorial > LINUX > What is the command to create a new folder in Linux?

What is the command to create a new folder in Linux?

下次还敢
Release: 2024-04-11 21:24:20
Original
818 people have browsed it

Linux The command to create a folder is mkdir, and the syntax is mkdir [option] folder name. Options include: -p recursively creates the parent directory; -v displays the creation process; -m sets permissions; -Z sets the SELinux context. Usage example: mkdir example or mkdir -p /path/to/example.

What is the command to create a new folder in Linux?

Linux command to create a new folder

In the Linux system, the command to create a folder is mkdir(make directory).

Syntax:

<code>mkdir [选项] 文件夹名</code>
Copy after login

Options:

  • -p (parents): Recursively create a parent directory that does not exist.
  • -v (verbose): Display the process of creating a folder.
  • -m(mode): Set the permissions of the folder.
  • -Z: Set up the SELinux context.

Using:

To create a new folder, enter the following command in the terminal:

<code>mkdir 文件夹名</code>
Copy after login

For example, to create Folder named "example", please run:

<code>mkdir example</code>
Copy after login

If you want to recursively create a parent directory that does not exist, please use the -p option:

<code>mkdir -p /path/to/example</code>
Copy after login

Other notes:

  • If the folder already exists, the mkdir command will not perform any operation.
  • The folder name can contain spaces, but must be enclosed in quotation marks.
  • You must have permission to create folders.

The above is the detailed content of What is the command to create a new folder in Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template