The mv
command is a utility that allows you to move or rename files and directories on a Unix or Linux system.
To use the mv
command, you can type mv
followed by the source file or directory and the destination file or directory.
For example, to move the file file.txt
from the current directory to the /tmp
directory, you can use the following command:
mv file.txt /tmp
This will move the file file.txt
from the current directory to the /tmp
directory.
To rename a file or directory, you can use the mv
command by specifying the same source and destination, but with a different name.
For example, to rename the file file.txt
to newfile.txt
, you can use the following command:
mv file.txt newfile.txt
This will rename the file file.txt
to newfile.txt
in the current directory.
The mv
command also has several options that allow you to customize the behavior of the command. For example, you can use the -f
option to force the move or rename operation, or the -i
option to prompt for confirmation before overwriting an existing file or directory.
For more information about the mv
command and its options, you can consult the documentation for your specific Unix or Linux system.