I have a block of text that looks like this:
<!-- BOF CLEAN --> ... a bunch of stuff <!-- EOF CLEAN -->
I'd like to remove this entire block. What's the sed command?
There is no available to delete all contents of the file. How to delete all contents of the file using sed command.
Find and replace text within a file using sed command The procedure to change the text in files under Linux/Unix using sed: Use Stream EDitor (sed) as follows: sed -i 's/old-text/new-text/g' input.txt. The s is the substitute command of sed for find and replace.
$ cat text abc <!-- BOF CLEAN --> ... a bunch of stuff <!-- EOF CLEAN --> def $ sed '/<!-- BOF CLEAN -->/,/<!-- EOF CLEAN -->/d' text abc def
http://www.catonmat.net/blog/sed-one-liners-explained-part-three/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With