mv [-f | -i] source_file target_file
mv [-f | -i] source_file ... target_dir
Description
In its first form, the mv utility renames the file named by the source_file operand to the destination path named by the target_file operand. This form is assumed when the last operand does not name an already existing directory.
In its second form, mv moves each file named by a source_file operand to a destination file in the existing directory named by the target_dir operand. The destination path for each source_file operand is the path name produced by the concatenation of target_dir, a slash, and the final path name component from source_file.
It is an error for either the source_file operand or the destination path to specify a directory except when both are directories.
If the destination path does not have a mode which permits writing, mv prompts the user for confirmation as specified for the -i option.
Options
Exit Status
Related information
Examplesmv -i perl5 /usr/bin