OSDN Git Service

Regular updates
[twpd/master.git] / rename.md
1 ---
2 title: rename
3 category: CLI
4 layout: 2017/sheet
5 ---
6
7 ### Installation
8
9 ```bash
10 brew install rename
11 ```
12
13 See: <http://plasmasturm.org/code/rename/>
14
15 ### Regex substitution
16
17 ```bash
18 rename 's/hello/world/' *.txt
19 ```
20
21 Rename `hello.txt` to `world.txt` and so on in `*.txt`.
22
23 ### Replace extension
24
25 ```bash
26 rename -s .png .jpg.png *.png
27 ```
28
29 Replace `.png` with `.jpg.png` in `*.png`.
30
31 ### Options
32
33 | Option | Description               |
34 | ---    | ---                       |
35 | `-n`   | Simulation                |
36 | `-l`   | Symlink instead of rename |
37 | `-i`   | Interactive               |
38
39 ## Also see
40
41 - [Rename website](http://plasmasturm.org/code/rename/) _(plasmasturm.org)_