From 96ecd31c47ed438ce9f95b28a4f4417bd0f8b818 Mon Sep 17 00:00:00 2001 From: Joshua Levy Date: Sun, 1 Nov 2015 19:26:29 -0800 Subject: [PATCH] Clarify rename command. Fixes #296. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e7407e1..656f628 100644 --- a/README.md +++ b/README.md @@ -207,12 +207,12 @@ Notes: perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt ``` -- To rename many files at once according to a pattern, use `rename`. For complex renames, [`repren`](https://github.com/jlevy/repren) may help. +- 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). ```sh - # Recover backup files foo.bak -> foo: - rename 's/\.bak$//' *.bak # Full rename of filenames, directories, and contents foo -> bar: repren --full --preserve-case --from foo --to bar . + # Recover backup files foo.bak -> foo: + rename 's/\.bak$//' *.bak ``` - As the man page says, `rsync` really is a fast and extraordinarily versatile file copying tool. It's known for synchronizing between machines but is equally useful locally. It also is among the [fastest ways](https://web.archive.org/web/20130929001850/http://linuxnote.net/jianingy/en/linux/a-fast-way-to-remove-huge-number-of-files.html) to delete large numbers of files: