mvx / cpx
Enhanced mv and cp commands with directory merging and progress bars.
Installation
This installs both mvx (move) and cpx (copy) binaries.
Usage
mvx [OPTIONS] <SOURCES>... <DEST>
cpx [OPTIONS] <SOURCES>... <DEST>
Options
| Option | Description |
|---|---|
-f, --force |
Overwrite existing files |
-n, --dry-run |
Show what would be done without actually doing it |
-q, --quiet |
Suppress progress bars and info messages |
-v, --verbose |
Show detailed output |
-h, --help |
Print help |
-V, --version |
Print version |
Behavior Matrix
Key differences from mv/cp: directories are merged (not nested), destination directories are created automatically, and existing files are never overwritten unless -f is specified.
Single source
| Source | Dest is file | Dest is directory | Dest doesn't exist | Dest doesn't exist (trailing /) |
|---|---|---|---|---|
| File | Overwrites (-f) |
Moves/copies into dir | Creates file | Creates dir, moves/copies into it |
| Dir | Error | Merges contents | Creates dir, merges | Creates dir, merges |
Multiple sources
All sources must be the same kind (all files or all directories).
| Sources | Dest is file | Dest is directory | Dest doesn't exist | Dest doesn't exist (trailing /) |
|---|---|---|---|---|
| Files | Error | Moves/copies each into dir | Error | Creates dir, moves/copies each into dir |
| Dirs | Error | Merges each into dir | Creates dir, merges each | Creates dir, merges each |
| Mixed | Error | Error | Error | Error |
Features
Progress Bars
Cross-device operations display progress bars with transfer speed and ETA:
1.2 GiB [========>-------------------------------] 312 MiB ( 45.2 MiB/s, ETA: 00:00:21 ) file.iso -> /mnt/backup/file.iso
Use -q to suppress progress output.
Fast Path Optimization
Same-device moves use rename (instant). Same-filesystem copies use reflink (copy-on-write clone on APFS/Btrfs). The buffered copy fallback with progress bars only kicks in when these fast paths aren't available.
Ctrl+C Handling
Press Ctrl+C once to finish the current file and stop. Press again to force exit immediately.
Examples
# Move a single file
# Copy multiple files to a directory
# Merge directories (preserve existing, fail on conflicts)
# Merge directories (overwrite conflicts)
# Copy with progress bar suppressed