rename
Verified for current stable LTS
Rename Command: Rename Files With Regex
Use for rename files with regex with Rename. Exact CLI syntax to rename files with regex using Rename.
When to use this: Use for rename files with regex with Rename.
Command Syntax
rename 's/<from>/<to>/' <*.txt> rename 's/<from>/<to>/' <*.txt> Command Breakdown
rename is the base executable for this command.
FAQ
Purpose: Exact syntax to rename files with regex using Rename.
Test path: Replace placeholders and run destructive commands in a disposable workspace first.
Flag behavior: Tool version, platform, and shell can change behavior.
Improve This Command
Suggest a correction, safer default, or version-specific note for this entry.
Related Operations
Rename Command: Capitalize First Letter Of Words
rename -f 's/\b(\w)/\U$1/g' <*.txt> Rename Command: Change File Extension rename 's/\.<old>$/\.<new>/' <*.txt> Rename Command: Convert Filenames To Lowercase rename -f 'y/A-Z/a-z/' <*.txt> Rename Command: Dry Run Rename Files rename -n 's/<from>/<to>/' <*.txt> Rename Command: Replace Spaces With Underscores rename 's/\s+/_/g' <*.txt>