sed: replace in place
sed: replace in place
Answer:
Newer version of sed allow you replace a file in place, no more redirection is needed.
# sed -i 's/abc/def/g' test.txt
The above command will replace all "abc" to "def" in the file test.txt
Related posts:
- How to replace a string in a file using Perl
- Search and replace string in file using Perl
- Replace multiple strings using sed
- How to determine the type of a file in Linux
- Speedup sed search and replace
One Trackback/Pingback
[...] using sed, Perl can also replace file in place with [...]
Post a Comment