1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-15 13:34:53 +02:00
Files
cheatsheets/rename.md
Rico Sta. Cruz 511de900ba Formatting updates (#2133)
- Update some sheets which have very long sections
- Remove `layout: 2017/sheet` (everything has the same layout now)
- Remove outdated sheets
2024-04-03 18:30:24 +11:00

41 lines
664 B
Markdown

---
title: rename
category: CLI
---
### Installation
```bash
brew install rename
```
See: <http://plasmasturm.org/code/rename/>
### Regex substitution
```bash
rename 's/hello/world/' *.txt
```
Rename `hello.txt` to `world.txt` and so on in `*.txt`.
### Replace extension
```bash
rename -s .png .jpg.png *.png
```
Replace `.png` with `.jpg.png` in `*.png`.
### Options
| Option | Description |
| --- | --- |
| `-n` | Simulation |
| `-l` | Symlink instead of rename |
| `-i` | Interactive |
## Also see
- [Rename website](http://plasmasturm.org/code/rename/) _(plasmasturm.org)_