Skip to content
SimpleConvertSimpleConvert

Linux mv Command

Moving and renaming with mv, why it is instant within a filesystem but slow across one, and how to avoid silently clobbering a file.

Formula
mv [OPTION]... SOURCE... DESTINATION

How to use it

  • The synopsis at the top shows the general form of the command.
  • Click any example to copy it straight to your clipboard.
  • The options table lists only the flags worth remembering — run man for the exhaustive list.

Examples

mv old.txt new.txtrename a file
mv file.txt ~/Documents/move it into a directory
mv -i *.log /var/log/move with a prompt before overwriting

Questions people ask

Why is mv instant for a huge file but slow to another disk?

Within one filesystem it only rewrites a directory entry — no data moves. Across filesystems it has to copy every byte and then delete the original.

How do I rename many files at once?

mv handles one at a time. Use a shell loop, or the rename utility, which takes a pattern and applies it to a whole set.

Does this page work offline?

Yes, after the first visit. The whole reference is part of the page and the service worker caches it.

Runs entirely in your browser. Nothing you type is uploaded, logged or shared.

Last updated 22 August 2026