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