The mv command in Linux is used to move or rename files and directories. Here are its primary functions:
-
Move Files: You can move a file from one location to another.
mv source.txt /path/to/destination/ -
Rename Files: You can rename a file or directory.
mv oldname.txt newname.txt -
Move and Rename: You can move a file and rename it in one command.
mv /path/to/source.txt /new/path/newname.txt
The command can also include options for safer operations, like -i for interactive mode, which prompts before overwriting files.
If you have more questions or need examples, feel free to ask!
