1 | # sed
|
2 |
|
3 | > Run replacements based on regular expressions
|
4 |
|
5 | - replace all occurrences of a string in a file, and print the result
|
6 |
|
7 | `sed 's/{{find}}/{{replace}}/g' {{filename}}`
|
8 |
|
9 | - replace all occurrences of a string in a file, and overwrite the file
|
10 | contents
|
11 |
|
12 | `sed -i '' 's/{{find}}/{{replace}}/g' {{filename}}`
|
13 |
|
14 | - replace all occurrences of an extended regular expression in a file
|
15 |
|
16 | `sed -E 's/{{regex}}/{{replace}}/g' {{filename}}`
|