Beginner Package: coreutils

mv

Move or rename files and directories.

Syntax

mv [options] source destination

Description

mv relocates a file or directory, and because renaming is just moving within the same directory, it is also the standard way to rename anything on Linux.

Examples

mv old-name.txt new-name.txt
Rename a file
mv report.pdf ~/Documents/
Move a file into another directory
mv -i *.log /var/log/archive/
Move multiple files, prompting before any overwrite

Applies to

Ubuntu Debian Linux Mint RHEL CentOS / Rocky / AlmaLinux Fedora Arch Linux openSUSE Alpine Linux