# Recommended: "The linux mv command is the abbreviation of move, which can be used to move files or rename files. Its command format is "mv [option] source file or directory target file or directory".
linux tutorial 》
The mv command is the abbreviation of move and can be used to move files or rename files (move (rename) files). Command formatmv [选项] 源文件或目录 目标文件或目录
1. When the second parameter type (target) in the mv command is a file, realize **rename** the source file or The function of the directory, remember that there can only be one source file or directory, because if there are multiple, there will be naming conflicts.
2. When the second parameter type (target) in the mv command is a directory,
movement is implemented Function of source files and directories. There can be multiple source files or directories. The mv command will move the source files or directories to the target directory.
3.mv -b: Back up the file before overwriting it.
4.mv -f (force): When overwriting a file, overwrite it directly without asking:
5.mv -i: Before overwriting the file, it will Ask whether to overwrite:
6.mv -u: The target file can only be overwritten when the source file is the latest update.
7.mv -t: This method is suitable when multiple source files need to be moved. At this time,
the target directory is first and the source file is last
The above is the detailed content of What is the use of linux mv command. For more information, please follow other related articles on the PHP Chinese website!