LinuxCommandLibrary

mmv

mass moves and renames files

TLDR

Rename with pattern
$ mmv '[*.txt]' '#1.bak'
copy
Move files
$ mmv '[dir1/*.c]' 'dir2/#1.c'
copy
Lowercase filenames
$ mmv '[*]' '#l1'
copy
Preview changes
$ mmv -n '[*.JPG]' '#1.jpg'
copy
Force overwrite
$ mmv -o '[*.old]' '#1.new'
copy

SYNOPSIS

mmv [options] from to

DESCRIPTION

mmv performs mass file moves, copies, appends, and links using shell-like wildcard patterns. It matches source files with a from pattern containing wildcards, then constructs target names using a to pattern where #1, #2, etc. refer to the text matched by each wildcard in the source pattern.
Special substitutions in the target pattern include #l and #u for lowercase and uppercase conversion. The tool plans all operations before executing, detecting and resolving collisions and cycles.

PARAMETERS

FROM

Source pattern.
TO
Target pattern.
-n
Dry run (no execute).
-o
Overwrite existing.
-v
Verbose output.
--help
Display help information.

CAVEATS

Pattern syntax differs from standard shell globbing. Always preview with -n before executing. Quoting patterns is essential to prevent shell expansion.

HISTORY

mmv was written by Vladimir Lanin and published in 1990. It provides mass file operations using pattern matching and substitution.

SEE ALSO

rename(1), mv(1), prename(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard