Online Linux Terminal Logo
OnlineLinuxTerminal
File OperationsCLI Reference

$mv

Move or rename files and directories.

Syntax DefinitionPOSIX standard
mv [OPTIONS] SOURCE... DEST
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `mv` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How mv Works

`mv` (Move) renames files and directories or moves them across different folder locations. If source and destination are on the same filesystem partition, `mv` is an atomic inode pointer update that executes instantly regardless of file size.

Common Flags & Command Options

Flag / OptionDescription
-iPrompt before overwriting an existing destination file.
-fForce overwrite without prompting.
-nDo not overwrite an existing file (no-clobber).
-vVerbose mode explaining actions being taken.

Practical Real-World Examples

Example #1Rename a file in the current directory
mv notes.txt project_ideas.txt && ls -l

Renames notes.txt to project_ideas.txt.

Sample Output:
-rw-r--r-- 1 user user 1200B project_ideas.txt

Frequently Asked Questions

Is moving a file between two folders on the same drive instantaneous?

Yes. On the same filesystem partition, `mv` simply re-links the directory inode without copying data blocks across disk.