man.lsPlain-English help for Unix commands

mv Move or rename files and directories

Moves a file or folder to another place, or renames it when the target is in the same folder. The original name no longer exists afterwards. Unlike cp, it does not need a flag to handle folders.

Synopsis

mv [OPTION]... SOURCE TARGET
mv [OPTION]... SOURCE... DIRECTORY

Common options

Option or formWhat it does
-iInteractive: ask before overwriting an existing file
-nDo not overwrite an existing file
-fForce: overwrite without asking, even if the target is write-protected
-vVerbose: print each file as it is moved
-hBSD and macOS: if the target is a symbolic link to a folder, do not follow it

Examples

Rename a file
mv notes.txt ideas.txt
Move a file into a folder
mv app.log docs
Move several files and see each one
mv -v photos/a.jpg photos/b.jpg docs
Rename a folder
mv photos pictures
Move without replacing anything that exists
mv -n data.csv docs/data.csv
Ask before overwriting
mv -i draft.docx final.docx

Notes

See also

Last reviewed 2026-10-07.