`sed` alternative for replacing strings in files

pull/171/head
grossws 2015-07-09 12:12:47 +03:00
parent 151bde506a
commit 77569eb830
1 changed files with 4 additions and 0 deletions

View File

@ -191,6 +191,10 @@ Notes:
```sh
perl -pi.bak -e 's/old-string/new-string/g' my-files-*.txt
```
Or use `sed` (it's more lightweight but its default regexp syntax differs from `perl`'s one, be carefull)
```sh
sed -i.bak '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.
```sh