Search code examples
unixsed

Linux sed with < and >


I want to replace all the entries of below string in a xml file

<level>error</level>

with

<level>debug</level>

Tried various option with sed, nothing to help. Could someone help?


Solution

  • Just use the substitute command:

    sed -e 's,<level>error</level>,<level>debug</level>,g'