Linux -- mv move files
MV(1) User Commands MV(1)
NAME _
mv - move (rename) files move (rename) files
SYNOPSIS Outline (Grammar)
mv [OPTION]... [-T] SOURCE DEST
mv [OPTION]... SOURCE... DIRECTORY
mv [OPTION]... -t DIRECTORY SOURCE...
DESCRIPTION _
Rename SOURCE to DEST, or move SOURCE(s) to DIRECTORY.
Move and modify the source filename to the destination filename, or move multiple files to the destination directory.
Mandatory arguments to long options are mandatory for short options too.
Arguments that are required for long options are also required for short options.
--backup[=CONTROL]
make a backup of each existing destination file
Make a backup of the existing target files.
-b
like --backup but does not accept an argument
Same as --backup, make a backup of the existing target file, but does not accept parameters.
-f, --force
do not prompt before overwriting
When the target file exists, it is directly overwritten without prompting.
-i, --interactive
prompt before overwrite
Give a prompt when the target file exists.
-n, --no-clobber
do not overwrite an existing file
Do not overwrite the existing target file, that is, do not operate when the target file exists.
If you specify more than one of -i, -f, -n, only the final one takes effect.
When two or more options among -i, -f, -n are specified, only the last option is valid.
--strip-trailing-slashes
remove any trailing slashes from each SOURCE argument
Remove the final slash "/" in the source file parameter.
-S, --suffix=SUFFIX
override the usual backup suffix
Reassign the backup file suffix.
-t, --target-directory=DIRECTORY
move all SOURCE arguments into DIRECTORY
Move all files to the specified directory.
-T, --no-target-directory
treat DEST as a normal file
Treat the target directory as a normal file
-u, --update
move only when the SOURCE file is newer than the destination file or when
the destination file is missing
If a file with the same name exists at the destination, the modification time is used as a reference, and the file with the latest time is kept. If there is no file with the same name at the destination, it will be moved directly.
-v, --verbose
explain what is being done
Show current progress.
-Z, --context
set SELinux security context of destination file to default type
--help
display this help and exit
Display help for this command and exit.
--version
output version information and exit
Display version information and exit.
The backup suffix is '~', unless set with --suffix or SIMPLE_BACKUP_SUFFIX. The version control method may be selected via the --backup option or through the VERSION_CONTROL environment variable. Here are the values:
The '~' suffix is used unless the --suffix option or SIMPLE_BACKUP_SUFFIX variable is set. The version control method is determined by the --backup option, or by the VERSION_CONTROL environment variable. The options are as follows:
none, off
never make backups (even if --backup is given)
Although the --backup parameter is given, no backup file is generated, that is, no backup is made
numbered, t
make numbered backups
Generate numbered backup files
existing, nil
numbered if numbered backups exist, simple otherwise
If there is a numbered backup file, use the numbered backup file, otherwise use the default backup method
simple, never
always make simple backups
Generate a simple backup file, the default backup method
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report mv translation bugs to <http://translationproject.org/team/>
AUTHOR
Written by Mike Parker, David MacKenzie, and Jim Meyering.
COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
rename(2)
The full documentation for mv is maintained as a Texinfo manual. If the info and mv programs are properly installed at your site, the command
info coreutils 'mv invocation'
should give you access to the complete manual.
The complete documentation for mv is maintained as a Texinfo manual. If both the info and mv programs are installed, execute the command:
info coreutils 'mv invocation'
should give you access to the entire manual.
GNU coreutils 8.22 June 2014 MV(1)