Terminal Dojo
Help العربية Sign inGet started

Command library / mv

mv

BashDraft — pending expert review3 practice missions

Move or rename files and directories

Moves a file or directory to a new location — and since a 'new location' can just be a new name in the same folder, mv is also how you rename things in the shell. -i asks before silently overwriting an existing file at the destination.

Practice mv

Usage

mv [-i] source destination

Options and flags

Examples

Common mistakes

mv report.txt mv report.txt archive/

mv always needs two things — where it's coming from AND where it's going — a destination is never optional.

Related commands

cpls