Linux command--MV

Source: Internet
Author: User
Tags bz2

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

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.