mv
Move or rename files and directories
Overview
Moves files or directories from one place to another, or renames them.
Syntax
mv [OPTION]... SOURCE DESTCommon Options
-i, --interactivePrompt before overwriting an existing file.
-f, --forceDo not prompt before overwriting (suppresses -i).
-n, --no-clobberDo not overwrite an existing file if it already exists.
-v, --verboseExplain what is being done.
-u, --updateMove only when the source file is newer than the destination file or when the destination file is missing.
Examples
$ mv oldfile.txt newfile.txt
Renames oldfile.txt to newfile.txt.
$ mv myfile.txt /tmp/
Moves myfile.txt to the /tmp/ directory.
$ mv -i source.txt target_dir/
Moves source.txt to target_dir/, prompting if a file with the same name exists.
$ mv my_directory/ another_location/
Moves my_directory into another_location/.
$ mv file1.txt file2.txt some_directory/
Moves file1.txt and file2.txt into some_directory/.
Related Commands
moverenamefilesdirectorymv