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

How to use the commonly used Linux command mkdir

下次还敢
Release: 2024-04-11 15:18:15
Original
860 people have browsed it

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>
Copy after login

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>
Copy after login
Create a directory named "newdir" and set permissions to "755":

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

<code>mkdir -p mydir/newdir</code>
Copy after login

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!

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