Linux--mv
MV is often used to make backups
Command parameters:
-B: Overwrite the previous backup if you need to overwrite the file.
-f:force mandatory Meaning, if the target file already exists, will not be asked and directly covered;
-I: If the target file (destination) already exists, you will be asked to overwrite it!
-U: If the target file already exists and source is newer, update (update)
-T:--target-directory=directory move all SOURCE arguments to directory,
That is, the target directory for the MV, which is used when moving multiple source files to a directory, when the destination directory is in front of the source file.
-------------------------------------------------------------------------------------------
Three ways to use MV
---------------------------------------------------------------
1. MV Original file target file (rename) MV Desktop.txt desktop.dl
[email protected] linux_order]$ LL
-rw-rw-r--1 DW DW 20548 July 4 11:50 desktop.txt
[Email protected] linux_order]$ MV Desktop.txt DESKTOP.DL
[email protected] linux_order]$ LL
-rw-rw-r--1 DW DW 20548 July 4 11:50 desktop.dl
----------------------------------------------------------------
2. MV Original file target folder mv Test.txt tar
[email protected] tar]$ LL
-rw-rw-r--1 DW DW 58 July 3 11:24 Test.txt
[Email protected] tar]$ mv Test.txt.
[email protected] tar]$ LL
[Email protected] tar]$ CD.
[email protected] linux_order]$ LL
Drwxrwxr-x 2 DW DW 4096 July 4 15:34 Tar
-rw-rw-r--1 DW DW 58 July 3 11:24 Test.txt
[Email protected] linux_order]$ mv Test.txt Tar
[Email protected] linux_order]$ CD tar/
[email protected] tar]$ LL
-rw-rw-r--1 DW DW 58 July 3 11:24 Test.txt
------------------------------------------------------------------
3, MV original file 1 original File 2 target folder mv Test.tar.z Test.txt.
[[email protected] tar]$ ls
test.tar.bz2 test.tar.gz test.tar.z test.txt test.zip
[Email protected] tar]$ mv Test.tar.z Test.txt.
[[email protected] tar]$ ls
TEST.TAR.BZ2 test.tar.gz Test.zip
[Email protected] tar]$ CD.
[[email protected] linux_order]$ ls
Desktop.dl Tar test.tar.z test.txt
Linux command--MV