https://github.com/bbaassssiiee/rename
🐪 Rename files with Perl power
https://github.com/bbaassssiiee/rename
file-utility linux-shell utilities
Last synced: over 1 year ago
JSON representation
🐪 Rename files with Perl power
- Host: GitHub
- URL: https://github.com/bbaassssiiee/rename
- Owner: bbaassssiiee
- License: mit
- Created: 2021-10-14T20:09:44.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T20:11:53.000Z (over 4 years ago)
- Last Synced: 2025-03-11T08:08:14.337Z (over 1 year ago)
- Topics: file-utility, linux-shell, utilities
- Language: Perl
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rename
Rename files with Perl power
# Rename files with regular expressions
For example, to rename all files matching *.bak to strip the extension, you might say:
```sh
rename 's/\.bak$//' *.bak
```
But you're not limited to simple substitutions - you have at your disposal the full expressive power of Perl. To add those extensions back on, for instance, say this:
```
rename '$_ .= ".bak"' *
```
or even:
```
rename 's/$/.bak/' *
```
To translate uppercase names to lowercase, you'd use:
```
rename 'tr/A-Z/a-z/' *
```
And how about these?
```
rename 's/foo/bar/; $_ = $was if -e' *foo*
```
```
find . -print | rename 's/readme/README/i'
```
```
find . -print | rename 's/$/.old/ if -M $_ > 0.5'
```