rename: update layout

This commit is contained in:
Rico Sta. Cruz 2017-10-16 14:41:14 +08:00
parent 99560e71bc
commit 2a67acf5c1
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
1 changed files with 26 additions and 10 deletions

View File

@ -1,24 +1,40 @@
---
title: rename
category: CLI
layout: 2017/sheet
---
### Installation
# http://plasmasturm.org/code/rename/
brew install rename
```bash
brew install rename
```
### Examples
See: <http://plasmasturm.org/code/rename/>
# Rename hello.txt to world.txt and so on
rename 's/hello/world/' *.txt
### Regex substitution
# Search and replace
rename -s .png .jpg.png *.png
```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
-n # Simulation
-l # Symlink instead of rename
-i # Interactive
| `-n` | Simulation
| `-l` | Symlink instead of rename
| `-i` | Interactive
## Also see
- [Rename website](http://plasmasturm.org/code/rename/) _(plasmasturm.org)_