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