From 2a67acf5c1e085076dc9bd2f18737c0afb568a1e Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Mon, 16 Oct 2017 14:41:14 +0800 Subject: [PATCH] rename: update layout --- rename.md | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/rename.md b/rename.md index e81bd3647..2be97e7ea 100644 --- a/rename.md +++ b/rename.md @@ -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: - # 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)_