The mv command has a few options that can modify its behavior. Here are some commonly used options:
-
-i(interactive): Prompts before overwriting an existing file or directory.mv -i source.txt destination.txt -
-u(update): Moves only when the source file is newer than the destination file or when the destination file does not exist.mv -u source.txt destination.txt -
-v(verbose): Displays detailed information about what the command is doing, showing each move operation.mv -v source.txt destination.txt -
-n(no-clobber): Prevents overwriting existing files. If the destination file exists, it will not be replaced.mv -n source.txt destination.txt
Example Usage:
To move a file with verbose output and prevent overwriting:
mv -vn source.txt destination.txt
These options can be combined as needed. If you have more questions or need further details, feel free to ask!
