LinuxCommandLibrary

rnm

Bulk rename files with patterns

TLDR

Search and replace in filenames

$ rnm -ss [old] -rs [new] [directory]
copy
Use literal strings (no regex)
$ rnm -ssf [old] -rs [new] [files]
copy
Add auto-increment index
$ rnm -i 1 -inc 1 -rs [_] [files]
copy
Rename from name list file
$ rnm -ns/f [names.txt] [files]
copy
Rename files only (not directories)
$ rnm -fo -ss [pattern] -rs [replacement] [files]
copy
Sort by modification time
$ rnm -s/mt -ss [pattern] -rs [replacement] [files]
copy
Simulate without changes
$ rnm -sim -ss [pattern] -rs [replacement] [files]
copy
Undo last operation
$ rnm -u
copy

SYNOPSIS

rnm [-ss pattern] [-rs replacement] [-sim] [-fo] [files...]

DESCRIPTION

rnm is a powerful bulk rename utility supporting regex, indexing, and name list files. It can rename files based on patterns, add sequential numbers, or use predefined name lists.
The tool includes simulation mode for previewing changes and undo functionality for reverting mistakes. It handles complex renaming scenarios with fine-grained control.

PARAMETERS

-ss _pattern_

Search string/regex
-ssf _string_
Fixed (literal) search string
-rs _replacement_
Replacement string
-i _start_
Starting index for numbering
-inc _step_
Index increment value
-ns/f _file_
Name list file
-fo
Files only (ignore directories)
-sim
Simulation mode (dry run)
-u
Undo last operation
-s/mt
Sort by modification time

CAVEATS

Regex mode is default; use -ssf for literal strings. Undo only works for the last operation. Test with -sim first on important files.

HISTORY

rnm was created by Md Jahidul Hamid (neurobin) as a comprehensive bulk rename solution with features missing from simpler rename tools.

SEE ALSO

rename(1), mmv(1), prename(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community