Linux file (clip) move, rename action command

Source: Internet
Author: User

The MV command is an abbreviation of move, which can be used to move files or rename files, and is a common command used in Linux systems, often to back up files or directories.
1. Command format:
MV [option] source file or directory destination file or directory
2. Command function:
Depending on the second parameter type in the MV command (either the destination file or the destination directory), the MV command renames the file or moves it to a new directory. When the second parameter type is a file, the MV command completes the file rename, at which point the source file can only have one (or the source directory name), which renames the given source file or directory to the specified destination file name. When the second parameter is a directory name that already exists, the source file or directory parameter can have more than one, and the MV command moves the source files specified by each parameter to the destination directory.
3. Common 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)
4. Command instance:
Example one: Renaming a file
Rename the file Zhidao.txt to Baidu.txt
MV Zhidao.txt Baidu.txt
Example two: Moving files
Move the file log1.txt,log2.txt,log3.txt to the directory test3.
MV Log1.txt Log2.txt Log3.txt test3

Linux file (clip) move, rename action command

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.