mv - move files
mv [-fi] source target mv [-fi] source ... directory
In its first form, the mv(1) utility renames the file named by the source operand to the destination path named by the target operand. This form is assumed when the last operand does not name an already existing directory.
In its second form, mv(1) moves each file named by a source operand to a destination file in the existing directory named by the directory operand. The destination path for each operand is the path name produced by the concatenation of the last operand, a slash, and the final path name component of the named file.
The following options are available:
If the destination path does not have a mode that permits writing, mv(1) prompts the user for confirmation as specified for the -i option.
As the rename(3) call does not work across file systems, mv(1) uses cp(1) and rm(1) to accomplish the move. The effect is equivalent to:
rm -f destination_path && \ cp -pr source_file destination && \ rm -rf source_file
Specifying more than one -f or -i options is not considered an error. The option which appears last on the command line is the one used.
The mv(1) utility exits 0 on success, and >0 if an error occurs.