The MV command of the CentOS Linux system command

Source: Internet
Author: User


in the In a Linux system, the command to move a file or directory is MV, and the MV command can also rename a file.

command format:mv [ options ] [ source file or directory ] [ destination file or directory ]

Parameter options:

--backup[=control] Backup of an existing file

- b similarto-backup, but accepts parameters

-F,--force is not prompted before overwriting.

-I,--interactive pre-overwrite hints

-U, the--update moved file is updated only if it is new to the source file compared to the target file.

-T, which specifies the target directory for MV, which is used when moving multiple source files to a directory where the destination directory is before the source file.

Command case:

1), file renaming, the file hello.txt modified named helloworld.txt, command format:MV Hello.txthelloworld.txt

[[email protected] ~]$ ls

Doucment hao.txt hello.txt One.txt

[Email protected] ~]$ MV Hello.txthelloworld.txt

[Email protected] ~]$ ls-l

Total Dosage 16

Drwxrwxr-x 2 Balich Balich 4096 8 months 07:56 doucment

-rw-rw-r--1 Balich Balich 8 months 07:48 hao.txt

-rw-rw-r--1 Balich Balich 8 months 07:44 helloworld.txt

-rw-rw-r--1 Balich Balich 8 months 07:52 one.txt

[Email protected] ~]$

2), move the file, move the helloworld.txt to the doucment file. Command format:MV Helloworld.txt document/. .

[Email protected] ~]$ MV helloworld.txtdoucment/

[Email protected] ~]$ ls-l doucment/

Total dosage 8

-rw-rw-r--1 Balich Balich 8 months 07:56 hao.txt

-rw-rw-r--1 Balich Balich 8 months 07:44 helloworld.txt

[Email protected] ~]$


This article is from the "Eight Miles Bridge" blog, please be sure to keep this source http://baliq.blog.51cto.com/5984262/1689942

The MV command of the CentOS Linux system command

Related Article

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.