The mv (move) command in the Linux/Unix operating system is used to move or rename files and directories. It allows you to move files from one directory to another, as well as rename files and directories in the current directory or in another directory. mv can be used to rename a file or directory if the new file or directory name is set in the same directory where the original file or directory is located.
The mv syntax looks like this:
To move a file to another directory, enter the full path to the source file and the target directory:
To rename a file in the current directory, specify the old file name and the new file name:
To rename a file in another directory, you must specify the full path to the file and the new file name:
There are also mv command options that can be used to more precisely control the movement of files and directories.
For example:
-f - overwrite the file without warning;
-i - request confirmation before overwriting the file;
-v - display information about moving files to the screen.
Example of using options:
This command asks for confirmation before renaming the file old_name.txt in new_name.txt .
Apply the discount by inserting the promo code in the special field at checkout: