One Linux command per day (5): mkdir command

Source: Internet
Author: User

Copyright Notice Update:2017-05-09
Bo Master: Luckyalan
Contact: [Email protected]
Statement: Draft not forget to dig well man, reproduced please indicate the source!

1 Article Introduction

This article describes the Linux command mkdir.

2 Development Platform

Linux

3 Pre-reading instructions

No

4 Article body

mkdir (make directory) is used to create a directory.

4.1 Command 4.1.1 Command

Command format: mkdir [options] Directory
Command function: Creates a directory at the specified location, requiring the user who created the directory to have write permissions in the current directory, and the specified directory name cannot be an existing directory in the current directory.

4.1.2 Parameters
    • -M or--mode set file mode (no drill down)
    • -P or--parents can be a path name. At this point, if some directories in the path do not already exist, and with this option, the system will automatically set up those directories that do not yet exist, that is, multiple directories can be established at one time
    • -V or--verbose each time you create a print creation message
    • -Z or--context (do not delve into it)
    • --help Display help page and exit
    • --version output version information and exit
4.2 Command Instances

Before we see a catalogue test (refer to 4.2.1).

4.2.1 Creating an empty directory

Command: mkdir test1

Use ll to view the following information:

4.2.2 Creating a directory recursively

Command: mkdir-p test2/test22

Use ll to view the following information:

4.2.3 Creating a directory with permissions of 777

The 777 permission refers to the current user's ability to read (R), write (w), and execute (x) the corresponding file.

Command: mkdir-m 777 test2

Use ll to view information such as:

As we can see, there is a bit of a difference from the directories we created 4.3.1, 4.3.2 (see the "One Linux command per day (2): ls command" For information that ll prints out).

4.3.4 Display information when creating a directory

Command: mkdir-v test4

Use ll to view information such as:

4.3.51 commands Create a directory structure for a project

Command:

1 mkdir-vp scf/{lib/,bin/,doc/{info,product},logs/{info,product},service/deploy/{info,product}}

From the above command we can see that in fact this is the use of the P and v two model (that is, the model can be a variety of) input effect is as follows:

Use Tree to view (first the tree is installed):

5 References

1, the concept of this part of the reference to Wikipedia.
2, this article is to a large extent from the "one Linux command per day (4): mkdir command."

One Linux command per day (5): mkdir command

Related Article

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.