The mv command has several options that enhance its functionality. Here are some common options:
-
-i(interactive): Prompts before overwriting an existing file.mv -i source.txt destination.txt -
-f(force): Moves files without prompting, even if it means overwriting existing files.mv -f source.txt destination.txt -
-n(no clobber): Prevents overwriting an existing file. If the destination file exists, the move will not occur.mv -n source.txt destination.txt -
-v(verbose): Displays detailed information about the move operation, showing what is being moved.mv -v source.txt destination.txt
Example Usage
To move a file with prompts for confirmation if it exists:
mv -i file.txt /path/to/destination/
To move multiple files and see what is being moved:
mv -v *.txt /path/to/destination/
These options can be combined as needed. If you have more questions or need further examples, feel free to ask!
