mv command
Move or rename files and directories.
- Files & directories
- Package coreutils
- 6 options · 6 examples
Syntax
mv [options] source… destinationProvided by the coreutils package. Run man mv for the full manual.
Common options
| Option | What it does |
|---|---|
-i | Ask before overwriting |
-n | Never overwrite existing files |
-f | Overwrite without asking |
-u | Move only when the source is newer |
-v | Print each file moved |
-t DIR | Move all sources into DIR |
Examples
Rename a file
mv old.txt new.txtMove a file into a directory
mv report.pdf ~/Documents/Move several files
mv *.log /var/log/archive/Ask before overwriting
mv -i file.txt /backup/Rename a directory
mv project project-oldMove with find results
find . -name "*.tmp" -exec mv -t /tmp/old {} +
No example matches. Check the options table or search the guides.
mv guides
- mv command in Linux with Useful Example Linux Commands · Updated Apr 2025
- (Resolved) -bash: /bin/mv: Argument list too long Shell Scripting · Updated Apr 2025
