mv [Command]

Command mv

Renames files and directories or move them from one directory to another.


mv [options] source destination


-b creates backup copies of files that are moved or renamed.
-f remove existing files without confirmation.
-i asks for confirmation before overwriting existing files.
-v displays the name of the file before moving.


The mv command renames a file or moves it to another directory. Command works with regular files and directories with. Thus, by using mv sample sample.old you can rename the file in the sample sample.old. With on the other hand, with the command mv /tmp/sample /usr/local/sample you can move the sample file in the directory /tmp/ to directory /usr/local/.


mv oldfilename newfilename

to change the file name

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.