How to move or rename files

Overview

mv handles both moving and renaming. A new name in the same directory renames an item; a directory destination relocates it.

Examples

mv draft.txt final.txt
mv final.txt ~/Documents/
mv report.txt ~/Documents/report-2026.txt
mv old-folder archive

Useful options

  • -i prompts before overwriting
  • -n never overwrites an existing destination
  • -v reports what moved
  • -t directory files... names the target directory first

Safety

mv can silently replace a destination file. Prefer mv -i or mv -n and use ls to inspect both locations.