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)