mv
mv功能说明:移动或更名现有的文件或目录。
语 法:mv [-bfiuv][--help][--version][-S <附加字尾>][-V <方法>][源文件或目录][目标文件或目录]
补充说明:mv可移动文件或目录,或是更改文件或目录的名称。
参 数:
-b或--backup 若需覆盖文件,则覆盖前先行备份。
-f或--force 若目标文件或目录与现有的文件或目录重复,则直接覆盖现有的文 件或目录。
-i或--interactive 覆盖前先行询问用户。
-S<附加字尾>或
--suffix=<附加字尾> 与-b参数一并使用,可指定备份文件的所要附加的字尾。
-u或--update 在移动或更改文件名时,若目标文件已存在,且其文件日期比源文件新,则不覆盖目标文件。
-v或--verbose 执行时显示详细的信息。
-V=<方法>或
--version-control=<方法> 与-b参数一并使用,可指定备份的方法。
--help 显示帮助。
--version 显示版本信息。
mv
mv [option] sources target
Move or rename files and directories. The source (first column) and target (second column) determine the result (third column):
Source
Target
Result
File
name (nonexistent)
Rename file to name.
File
Existing file
Overwrite existing file with source file.
Directory
name (nonexistent)
Rename directory to name.
Directory
Existing directory
Move directory to be a subdirectory of existing directory.
One or more files
Existing directory
Move files to directory.
The mv command is often aliased as mv -i in the
Options
Back up files before removing.
Like -b, but can take an argument specifying the type of version-control file to use for the backup. The value of type overrides the VERSION_CONTROL environment variable, which determines the type of backups made. The acceptable values for version control are:
t, numbered Always make numbered backups.
nil, existing Make numbered backups of files that already have them, and make simple backups of the others. This is the default.
never, simple Always make simple backups.
none, off Never make backups.
Force the move, even if target file exists; suppress messages about restricted access modes. Same as --reply=yes.
Print a help message and then exit.
Query user before removing files. Same as --reply=query.
Specify how to handle prompt if the destination exists already. Possible values are yes, no, and query.
Remove trailing slashes from source paths.
Override the SIMPLE_BACKUP_SUFFIX environment variable, which determines the suffix used for making simple backup files. If the suffix is not set either way, the default is a tilde (~).
Move all source files and directories into the specified directory.
Do not remove a file or link if its modification date is the same as or newer than that of its replacement.
Print the name of each file before moving it.
Print version information and then exit.