Linux Command (3): mkdir command, linux Command mkdir

Source: Internet
Author: User

Linux Command (3): mkdir command, linux Command mkdir

1. Role: create a directory;

2. Format: mkdir [Option] path;

3. Common parameters:

4. Example:

[Root @ localhost ~] # Mkdir-p./hello/my

[Root @ localhost ~] # Pwd (view the current directory command)

/Root/hello/my

This instance uses the option "-p" to create a./hello/my multi-level directory at a time.

[Root @ localhost ~] # Mkdir-m 777./why

[Root @ www my] # ls-l total 4 drwxrwxrwx 2 root 4096 Jan 14 why

This instance uses the "-m" option to create a directory with the corresponding permissions. The "777" permission will be described in detail later in this section.

5. Instructions for use:

This command requires that the user who creates the directory has write permission in the parent directory of the created path, and the path name cannot be an existing directory or file name in the current directory.


Linux commands

1. cp command
This command is used to copy the given file or directory to another file or directory. It is very powerful like the copy command in MSDOS.
Syntax: cp [Option] source file or directory target file or directory
The options are as follows:
-A this option is usually used when copying directories. It retains links and file attributes, and Recursively copies directories. Its role is equal to the combination of dpR options.
-D: the link is retained during copy.
-F delete an existing target file without prompting.
-I and f options are opposite. A prompt is displayed asking the user to confirm before overwriting the target file. When the answer is y, the target file will be overwritten, which is an interactive copy.
-P in addition to copying the source file content, cp also copies the modification time and access permissions to the new file.
-If the source file provided by r is a directory file, cp will recursively copy all subdirectories and files in the directory. The target file must be a directory name.
-L do not copy, but only link files.
2. mv command
You can use the mv command to rename a file or directory or move the file from one directory to another. This command is like a combination of ren and move in MSDOS.
Syntax: mv [Option] source file or directory target file or directory
The options are as follows:
-I interactive operation. If the mv operation will overwrite the existing target file, the system will ask whether to rewrite the file and ask the user to Answer y or n. This will avoid overwrite the file by mistake.
-F prohibit interactive operations. When an mv operation overwrites an existing target file, no instructions are given. If this option is specified, the I option will no longer work.
3. mkdir command
Function: create a directory (similar to the md command in MSDOS ).
Syntax: mkdir [Option] dir-name
-M sets the access permission for the new directory. You can also set it using the chmod command.
-P can be a path name. If some directories in the path do not exist, after this option is added, the system automatically creates those directories that do not exist, that is, multiple directories can be created at a time.

Teach a few simple LINUX commands

Where did these cainiao copy them ...... Lips and lips
Let me give you an answer:
/// 1. //////////////////////////////////////// ///////////////
Ls./[a-zA-Z] *
/// 2. //////////////////////////////////////// //////////////
2.1 Delete the user: userdel-r auge
2.2 add group: groupadd iaige

/// 3. //////////////////////////////////////// ///////////////
This function cannot be completed in one command.
To configure the NIC address, you must first remove the NIC: ifconfig eth0 down
Then configure and enable: ifconfig eth0 192.168.0.12 netmask 255.255.255.0 up
Configure the network route parameters: route add-net 192.168.0.0 \
Configure the network's mask: netmask 255.255.255.0 dev eth0
Add Gateway: route add default gw 192.168.0.1
Restart the network service: service network reload
<Complete>

/// 4. //////////////////////////////////////// //&...... remaining full text>

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.