Shell Share mkdir command

Source: Internet
Author: User
Tags parent directory
The common options directory is present without an error (at this time there is no effect on the directory), there is the creation of mkdir-p, if there is a need to create a parent directory when creating a directory when the parent directory is created Mkdir-m example: Create a multilevel directory Mkdir-p A/B/C/D (create a directory, and in A directory to create a B directory, under the B directory to create a C directory, in the C directory to create a D directory to create a multi-level directory Mkdir-p A/{B1,B2,B3/{C1,C2,C3},B4} (Create a directory, under the A directory to create B1,B2,B3,B4 directory, Create the C1,C2,C3 directory under the B3 directory) when you create the directory and specify the directory permissions mkdir-m0666 A, create a directory, and the A directory is 0666, of course, if the a directory exists, then this command is not valid, this command does not modify the existing properties of a directory note: before someone mentioned What is the difference between that and mkdir * 2>/dev/null, the difference is mkdir-p an existing directory, will not error The result is successful, and mkdir * 2>/dev/null just the wrong results redirect masked out, but the result is a failure, can echo $? Look at the result verification.

Shell Share 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.