rename
file managementLinux/Unix
The rename command is one of the most frequently used commands in Linux/Unix-like operating systems. rename Rename multiple files using pattern substitution
Quick Reference
Command Name:
rename
Category:
file management
Platform:
Linux/Unix
Basic Usage:
rename [options] [arguments]
Common Use Cases
Syntax
rename [options] expression replacement file...
Options
| Option | Description |
|---|---|
-v, --verbose |
Show which files were renamed |
-n, --no-act |
Do not make any changes (dry run) |
-f, --force |
Overwrite existing files |
-h, --help |
Display help message and exit |
-V, --version |
Output version information and exit |
-o, --no-overwrite |
Don't overwrite existing files (some versions) |
-i, --interactive |
Prompt before overwriting (some versions) |
-s, --symlink |
Act on symlinks instead of their targets (some versions) |
Examples
How to Use These Examples
The examples below show common ways to use the rename command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.