Let's assume I have my_file:
First line
<file>dsdsd</file>
Middle line
<file>sdsfs</file>
<file>asasa</file>
End line
After this command:
sed -i '/<file>/,/<\/file>/d' my_file
I expect to see only these lines:
First line
Middle line
End line
Why do I see only the "First line" ? How to fix it ? It's just an example of the text. My goal: remove all tags from the file.
Thanks, Alex
You need a regex like this to remove the lines
However, if your intention is to parse XML/HTML you may need other tools rather than
sed.