Here are additional options for the mv command:
-
-i: Interactive mode. Prompts for confirmation before overwriting an existing file.mv -i source_file destination/ -
-f: Force move. Overwrites existing files without prompting for confirmation.mv -f source_file destination/ -
-u: Update. Moves the file only if the source file is newer than the destination file or if the destination file does not exist.mv -u source_file destination/ -
-v: Verbose. Displays detailed information about the move operation, showing what is being moved.mv -v source_file destination/ -
-n: No clobber. Prevents overwriting existing files. If the destination file exists, the move will not occur.mv -n source_file destination/ -
--backup: Creates a backup of the destination file if it exists before overwriting it. You can specify the type of backup with additional options.mv --backup source_file destination/ -
--strip-trailing-slashes: Removes trailing slashes from the destination path, which can be useful when specifying directories.mv --strip-trailing-slashes source_file destination/ -
--help: Displays help information about themvcommand and its options.mv --help -
--version: Displays the version information of themvcommand.mv --version
These options can be combined as needed to customize the behavior of the mv command. For example:
mv -iv source_file destination/
This command will prompt before overwriting and provide verbose output about the move operation.
