Home >System Tutorial >LINUX >What is the operation of creating a new folder in linux command

What is the operation of creating a new folder in linux command

下次还敢
下次还敢Original
2024-04-11 21:27:18916browse

Under Linux, you can use the mkdir command to create a new folder. Options include: -p (recursively create directories) -v (show details) -m (set file permissions). For example, mkdir test_dir creates a folder named test_dir, mkdir -p test_dir/sub_dir creates subdirectories recursively with -p, and mkdir -m 755 new_dir creates a folder named new_dir and sets permissions to 755.

What is the operation of creating a new folder in linux command

Linux command to create a new folder operation

In the Linux operating system, you can use ## to create a new folder #mkdir command.

Command syntax:

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

Options:

  • -p: recursive creation Directories (create parent directories if necessary)
  • -v: Display details for each directory created
  • -m: Set directory files Permissions

Example:

    Create a folder named "test_dir":
<code>mkdir test_dir</code>
    Recursively create a folder named "test_dir/sub_dir" using the
  • -p option:
<code>mkdir -p test_dir/sub_dir</code>
    Create a folder named "new_dir" and set the file permissions to 755:
<code>mkdir -m 755 new_dir</code>

Note:

    The folder name can only contain letters, numbers, underscores and hyphens.
  • When specifying the folder path, you must use an absolute path or a relative path.
  • If you want to create multiple folders, you can use spaces to separate them.

The above is the detailed content of What is the operation of creating a new folder in linux command. 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