Mkdir command in CentOS

Source: Internet
Author: User

Mkdir command in CentOS

Mkdir: the abbreviation of make directory (ies), used to create a directory

1. Syntax

Mkdir [OPTION]... DIRECTORY

Note: option is a selection and optional. directory is the name of the directory to be created.

2. Options

3. Parameters

Directory: Specify the directory to be created. multiple directories are separated by spaces.

4. Instances

[Root @ oldboy/] # mkdir oldboy # create the oldboy directory under the root/directory

[Root @ oldboy/] # mkdir oldboy # If the directory already exists, you cannot create a directory.

Mkdir: Unable to create directory "oldboy": The file already exists

[Root @ oldboy/] # mkdir-p oldboy/test/geng #-p is a recursive directory. If a file exists, it will not be treated as an error. If the file does not exist, create a directory layer by layer.

-V parameter to display the Directory creation process:

[Root @ oldboy/] # mkdir-p oldboy/a/B/c-v #-v parameter indicates the Directory creation process.

Mkdir: You have created the directory "oldboy/a" # first create directory

Mkdir: directory "oldboy/a/B" # create directory B

Mkdir: the directory "oldboy/a/B/c" has been created. # create directory c.

Note: The-p parameter is commonly used to create a directory recursively. If a directory exists, no error occurs. The-v parameter shows the Directory creation process, which is not commonly used, beginners can refer to the Directory creation process to understand how the-p parameter is recursively created.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.