mvx - Enhanced File and Directory Move Utility
mvx is a command-line utility for moving files and directories with progress bars and enhanced features. It's designed to be a more user-friendly alternative to the standard mv command, providing visual feedback during operations and handling cross-device moves gracefully.
Features
- Move files with visual progress bars
- Merge directories intelligently
- Handle cross-device moves automatically
- Create destination directories as needed
- Quiet mode for scripting
Usage
mvx [OPTIONS] <SOURCE> <DESTINATION>
Options
-q, --quiet: Suppress progress bars and messages-h, --help: Print help information-V, --version: Print version information
Examples
Move a file to a new location:
Move a file and rename it:
Move a directory and merge with an existing directory:
Move in quiet mode (no progress bars):
Behavior Documentation
File Moves
-
Basic File Move: When moving a file to a destination that doesn't exist, the behavior depends on whether the path ends with "/".
- If the destination path ends with "/",
mvxwill create the directory and place the file inside it. - If the destination path doesn't end with "/",
mvxwill create all necessary parent directories and move the file to that exact path.
- If the destination path ends with "/",
-
Move to Directory: When moving a file to an existing directory, the file is placed inside that directory with its original filename.
-
Overwriting Files: If the destination file already exists, it will be overwritten by the source file.
-
Cross-device Moves: When moving files between different filesystems/devices,
mvxwill automatically copy the file and delete the original, showing progress during the operation.
Directory Moves
-
Directory Merge: When moving a directory to an existing directory,
mvxwill merge the contents, preserving files in the destination that don't conflict with files from the source. -
Overwriting Files in Directory Merge: During a directory merge, if files with the same name exist in both source and destination, the source files will overwrite the destination files.
-
Preserving Directory Structure: When merging directories, the entire directory structure from the source is preserved in the destination.
Error Handling
-
Nonexistent Source: If the source file or directory doesn't exist,
mvxwill display an error message and exit without making any changes. -
Cannot Create Parent Directory: If a parent directory cannot be created (e.g., because an intermediate path component is an existing file),
mvxwill display an error message and exit without moving the file.