Home > System Tutorial > Linux > body text

How to use the commonly used Linux command mkdir

下次还敢
Release: 2024-04-11 15:18:15
Original
666 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:

mkdir [选项] 目录名
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":

mkdir newdir
Copy after login
Create a directory named "newdir" and set permissions to "755":

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

mkdir -p mydir/newdir
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 [email protected]
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!