From 122a25db8c164ba6df7213cc442a2a1f0899b0ee Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Mon, 2 Nov 2015 10:20:25 -0800 Subject: [PATCH] More fixups on repren and rename. Re #296. --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 218ab42..d5f74d3 100644 --- a/README.md +++ b/README.md @@ -207,11 +207,13 @@ Notes: perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt ``` -- To rename many files and/or search and search and replace within files, try [`repren`](https://github.com/jlevy/repren). The `rename` command also does renames on some Linux distributions (but it is less consistently available). +- To rename multiple files and/or search and replace within files, try [`repren`](https://github.com/jlevy/repren). (In some cases the `rename` command also allows multiple renames, but be careful as its functionality is not the same on all Linux distributions.) ```sh # Full rename of filenames, directories, and contents foo -> bar: repren --full --preserve-case --from foo --to bar . - # Recover backup files foo.bak -> foo: + # Recover backup files whatever.bak -> whatever: + repren --renames --from '(.*)\.bak' --to '\1' *.bak + # Same as above, using rename, if available: rename 's/\.bak$//' *.bak ```