Linux Command for creating folders in mkdir

Source: Internet
Author: User

Linux (Ubuntu/Fedora/CentOS/RetHat) allows you to directly create folders and file directories on the GMONE and KDE interfaces. Of course, it is more convenient to directly use the mkdir command on the terminal, especially in folders and directories with Root permissions. Normal users cannot directly create folders and directories, in this case, you can use the mkdir command on the terminal to create the mkdir command. The following describes how to use the mkdir command.

I. mkdir command permission

All users can use the mkdir command on the terminal to create folders or directories in folders with permissions.

Ii. Format of the mkdir command

Format: mkdir [Option] DirName

Iii. mkdir command functions

The mkdir command can be used to create a folder or directory named by DirName at a specified position. To create a folder or directory, you must have the write permission on the parent folder of the created folder (Click here to learn about Linux File-Folder permissions ). In addition, the created folder (directory) cannot have the same name as the file name in its parent directory (that is, the parent folder), that is, the same directory cannot have the same name (case sensitive ).

Iv. mkdir Command Options

The [Options] in the Command generally have the following two types:

-M is used to set the access permission for the new directory. You can also use the chmod command to set the access permission.

-P is required to create an upper-level folder (or directory). If the folder (or directory) already exists, it is not considered as an error.

V. mkdir command example

Example 1: Create a folder named "it.dengchao.org" under/home/cc.

Run the following command.

Mkdir/home/cc/it.dengchao.org Example 2: Create a folder named "it.dengchao.org" under/home/cc/and grant permissions to the folder. The permission is 777.

Mkdir 777/home/cc/it.dengchao.org

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.