Linux mv Command Tutorial with Examples To Move Files

Linux mv command is used to move or rename files. We generally provide the source and destination files and directories to mv command.




The regular usage of mv command is moving files or directories. We will provide source files or directory and destination file or directory. In this example we will move or rename directory named backup into live .

$ mv backup live


If there is files and folders in  the destination the mv command will stop moving. We can force move operation with -f option.

$ mv -f backup live

Ask Before Overwrite

We can prompt before overwriting destination file. We will use -i option for this. In order to accept overwrite we should answer with y or Y .

$ mv -i backup live


While moving files we may need to list all moved files. We call this verbose mode. This will list moved files line by line with -v option like below.

$ mv -v backup live

LEARN MORE  Linux Rename Files And Folders With Rename Command With Examples

Leave a Comment