Home > Software design >  How to grep for a long html string with quotes and carriage returns
How to grep for a long html string with quotes and carriage returns

Time:10-19

I need to recursively find all files that contain the following HTML:

<html id="blx-5fb3c619e82a2863d6567c52-000000001" >
    <head>
    <meta charset="utf-8">
    <meta name="google" value="notranslate">

I'm trying the following with no success:

grep --include=\*.html -FRnw "/path-to-dir" -e '<html id="blx-5fb3c619e82a2863d6567c52-000000001" >\n    <head>\n    <meta charset="utf-8">\n    <meta name="google" value="notranslate">'

What am I doing wrong ?

CodePudding user response:

With GNU grep. Remove -F, -n and "/path-to-dir" and add -Poz.

  • Related