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 |
-q, --quiet |
Suppress progress bars and info messages |
-v, --verbose |
Show detailed output |
-h, --help |
Print help |
-V, --version |
Print version |
Features
Directory Merging
Unlike standard mv/cp, when the destination is an existing directory, mvx/cpx merges contents instead of nesting:
# Standard mv: creates dest/source_dir/
# mvx: merges source_dir/* into dest/*
Files unique to the destination are preserved. Overlapping files require -f to overwrite.
Safe by Default
Existing files are never overwritten unless -f is specified:
# Fails if dest/file.txt exists
# Overwrites dest/file.txt if it exists
Automatic Directory Creation
Destination directories are created automatically:
# Creates /path/to/new/dest/ if it doesn't exist
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.
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
Differences from mv/cp
| Behavior | mv/cp | mvx/cpx |
|---|---|---|
| Directory to existing directory | Nests source inside dest | Merges contents |
| Destination doesn't exist | Fails (for directories) | Creates automatically |
| File exists at destination | Overwrites silently | Fails (use -f to overwrite) |
| Cross-device operations | No progress indication | Shows progress bar |