Linux Study Notes-mv command (cut or rename)

Source: Internet
Author: User

Linux Study Notes-mv command (cut or rename)

Mv: The English name "move" indicates "move.

1. Command Format:

Mv [Option] source file or directory target file or directory mv [Option] source file 1 source file 2 source file 3... target directory

2. Common options:

"Mv-B" if a file with the same name already exists in the target directory, back up the file before overwriting. "mv-f" if a file with the same name already exists in the target directory, no prompt is required, directly overwrite "mv-I" man-machine interaction. If a file with the same name already exists in the target directory, the system prompts whether to overwrite "mv-u". If a file with the same name already exists in the target directory, only when the source file is updated will the update overwrite "mv-v" to show the detailed operation steps. (V indicates verbose)

3. Note:

1) the "-r" option does not need to be included when the "mv" command is used to operate the directory. Remember this. (when operating the directory with commands such as "cp" and "rm, (required with the "-r" option) 2) when the directory where the source file is located is different from the target directory, it is a cut operation. When the directory where the source file is located is the same as the target directory, is the renaming operation.

4. Common examples:

1) Move the file to another directory

2) Move multiple files to another directory

<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4NCjxwcmUgY2xhc3M9 "brush: SQL;"> 3) Move the file to another directory. If there is a file with the same name in the target directory, back up the file first.

4) Move the file to another directory. If the target directory contains a file with the same name, a prompt is displayed first.

5) Move the file to another directory and print the Mobile Information

6) Move the file to another directory without overwriting the existing file

7) Move the Directory

8) rename a file

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.