mv Linux Command Cheatsheet

1683




mv (move) Linux Command is used to move one or more file/directories from one place to another. This also used to rename files/directories

Syntax

mv [Option(s)] [source] [destination]

Options

OptionDescription
-iInteractively move
-fForce override destination

Example

Renaming a file

mv readme.txt readme-v2.txt

Moving file to user home folder

mv readme.txt ~/

Moving file to given destination directory

mv readme.txt /path/to/destination/