The Linux mv Command: Move and Rename
The Linux mv Command: Move and Rename
mv moves files and directories, or renames them. It's essentially a copy + delete operation.
Basic Usage
Move file
mv file.txt /new/path/
Rename
mv oldname.txt newname.txt
Move multiple
mv file1.txt file2.txt /dest/
Options
-i— Interactive (prompt before overwrite)-n— No clobber (don't overwrite)-v— Verbose-u— Update (only if newer)-t— Move to target directory
Examples
Move and rename
mv -v oldfile newfile
Interactive move
mv -i file.txt /dest/
