How to Move or Rename Files in Linux (mv)
mv moves a file or directory to a new location, or renames it if the destination is in the same directory.
Published September 30, 2026
mv moves a file or directory to a new location, or renames it if the destination is in the same directory.
Key points
- There's no separate "rename" command in Linux — mv oldname.txt newname.txt renames a file
- Moving across different filesystems/drives may take noticeably longer than a rename on the same filesystem
- mv -i prompts before overwriting a file that already exists at the destination
Example
mv old-name.txt new-name.txt