← 返回命令列表

Linux command

mmv 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Rename with pattern

mmv '[*.txt]' '#1.bak'

Move files

mmv '[dir1/*.c]' 'dir2/#1.c'

Lowercase filenames

mmv '[*]' '#l1'

Preview changes

mmv -n '[*.JPG]' '#1.jpg'

Force overwrite

mmv -o '[*.old]' '#1.new'

说明

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.

参数

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

FAQ

What is the mmv command used for?

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.

How do I run a basic mmv example?

Run `mmv '[*.txt]' '#1.bak'` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -n do in mmv?

Dry run (no execute).