Ubuntu "mkdir-p" command

Source: Internet
Author: User

The-p option of mkdir allows you to create multiple levels of directories at once rather than just creating separate directories at a time. For example, to create a directory projects/a/src in the current directory, use the command:

Mkdir-p PROJECT/A/SRC

Instead of:

mkdir Project

CD Project

mkdir ACD amkdir src

Of course, if you have MKCD, you can directly

MKCD PROJECT/A/SRC

In addition, if we want to create a multi-level, multidimensional directory tree, MKCD also looks pale. For example, we want to create directory project, which contains 4 folders A, B, C, D, and these 4 files contain a src folder. Maybe we can create one on one, but I prefer to use a single command, and MkDir's-p option and Shell's parameter extension allow me to do this, such as the following command to complete the task.

Mkdir-p PROJECT/{A,B,C,D}/SRC

Ubuntu "mkdir-p" command

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.