Home  >  Article  >  System Tutorial  >  How to use the commonly used Linux command mkdir

How to use the commonly used Linux command mkdir

下次还敢
下次还敢Original
2024-04-11 15:18:15752browse

Create a directory. Syntax: mkdir [options] Directory name. Options: -p: There is no upper-level directory automatically created; -m: Set directory permissions; -v: Output detailed information. Example: Create a directory named "newdir": mkdir newdir. Set permissions to "755": mkdir -m 755 newdir. Create in the non-existing parent directory "mydir": mkdir -p mydir/newdir.

How to use the commonly used Linux command mkdir

Linux common commands: mkdir

Purpose: Create directory

Syntax:

<code>mkdir [选项] 目录名</code>

Options:

  • ##-p: Automatically if the parent directory does not exist Create
  • -m: Set directory permissions
  • -v: Output details

Example :

Create a directory named "newdir":

<code>mkdir newdir</code>
Create a directory named "newdir" and set permissions to "755":

<code>mkdir -m 755 newdir</code>
Create the "newdir" directory in the non-existent parent directory "mydir":

<code>mkdir -p mydir/newdir</code>

Note:

    The mkdir command only creates the directory, not the directory. document.
  • The directory name must be a valid Linux file name.
  • If the directory already exists, the mkdir command will display an error message.
  • Permission settings are controlled by the umask value and can be viewed through the "umask" command.

The above is the detailed content of How to use the commonly used Linux command mkdir. 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