rename

Rename multiple files with a pattern

high risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
Safer / dry-run alternatives
rename -n 's/old/new/' *.txtDry run first
What it does

Renames files using a Perl regex (Debian/Ubuntu) or a simple string substitution (util-linux). Syntax differs between implementations.

Common flags
FlagMeaning
-nDry run: show what would be renamed (Perl rename)
-vVerbose
-fForce overwriting existing files
Examples
rename -n 's/\.jpeg$/.jpg/' *.jpegPreview renaming .jpeg to .jpg · explain & risk-check →
rename 's/ /_/g' *Replace spaces with underscores · explain & risk-check →
Related
mv find
Open the full explainer →More in Files & Archives

Reference text is hand-written and may be incomplete — check man rename for your version. Test destructive commands on a non-production system first.