Linux mkdir Basic Command summary

Source: Internet
Author: User

User command mkdir

Describe:

The mkdir command enables you to create a folder or directory at the specified location, and the user who creates the folder or directory must have write permission to the parent directory of the directory being created, and the created directory cannot have the same name as the parent directory (strictly case-sensitive)

Command mkdir– Create directory (full name: Make directories)

mkdir [parameters] ... Directory name ...

Parameters

- m--mode Set Current Permissions

- P--parents can be the name of a path. If the directory in the path does not exist, then the system automatically creates directories that do not already exist, i.e. multiple directories can be created at one time

- v--verbose Displays information each time a new catalog is created

--help Display this help message and exit

--version output version information and exit

Command instance:

Example 1: Create an empty directory named 51cto under the root directory

Command: mkdir 51cto

[Email protected] ~]# mkdir 51cto

View command: LS (show directory only) or ll (show directory details, permissions, create user, time, etc.)

[Email protected] ~]# mkdir 51cto
[[email protected] ~]# ls
51cto anaconda-ks.cfg install.log install.log.syslog test YEMA1
[email protected] ~]# LL
Total 60
Drwxr-xr-x. 2 root root 4096 Dec 14:51 51cto
-RW-------. 1 root root 1295 Dec 23:32 anaconda-ks.cfg
-rw-r--r--. 1 root root 28865 Dec 23:32 Install.log
-rw-r--r--. 1 root root 7572 Dec 23:30 install.log.syslog
Drwxr-xr-x. 2 root root 4096 Dec 09:51 test
Drwxr-xr-x. 3 root root 4096 Dec 09:45 yema1

Example 2: Creating a recursive directory in the root directory with the-p parameter auto/auto2

Command: mkdir–p auto/Auto2

[Email protected] ~]# mkdir-p Auto/auto2

Use LS and ll to view

[[email protected] ~]# ls
51cto anaconda-ks.cfg Auto Install.log install.log.syslog
[email protected] ~]# LL
Total 64
Drwxr-xr-x. 2 root root 4096 Dec 14:51 51cto
-RW-------. 1 root root 1295 Dec 23:32 anaconda-ks.cfg
Drwxr-xr-x. 3 root root 4096 Dec 14:54 auto
-rw-r--r--. 1 root root 28865 Dec 23:32 Install.log
-rw-r--r--. 1 root root 7572 Dec 23:30 install.log.syslog


Example 3: Create a directory to display information

Command Mkdir–v auto1

[Email protected] ~]# mkdir-v auto1
mkdir:created directory ' auto1 '


Please correct me in the wrong place!

This article is from the "Go to It" blog, make sure to keep this source http://518443.blog.51cto.com/508443/1596235

Linux mkdir Basic Command summary

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.