MV Command (move and rename)

Source: Internet
Author: User

MV (move) in the format " mv "Options" "Source Files" "Destination Files" ". ( can not only move files, but also to move the directory )

- I. : asks if the user wants to overwrite when the target file is present. In the Redhat/centos system, the MV we use is actually mv-i

the command has the following conditions :

(1) The target file is a directory, and the directory file does not exist;

(2) The target file is a directory, and the target file exists;

(3) The target file is not a directory does not exist;

(4) The target file is not a directory existence;

The destination file is a directory, exists and does not exist, the result of the move is the same, if present, the source file will be moved to the target file directory. If it does not exist, the destination file is a file when it is finished moving.

If in the same directory, that is the change of name;

If the target file already exists, you will be asked if you want to overwrite it;

If the target is a directory and the directory does not exist, (the source is also a directory, it will change the name of the directory);

If the target directory already exists and the source is a directory, then he will put the directory inside the target directory.


This article from "12350027" blog, declined reprint!

MV Command (move and rename)

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.