standac
standac

Reputation: 1097

How to grep for a long html string with quotes and carriage returns

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

<html id="blx-5fb3c619e82a2863d6567c52-000000001" class="blx-5fb3c619e82a2863d6567c52">
    <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" class="blx-5fb3c619e82a2863d6567c52">\n    <head>\n    <meta charset="utf-8">\n    <meta name="google" value="notranslate">'

What am I doing wrong ?

Upvotes: 0

Views: 63

Answers (1)

Cyrus
Cyrus

Reputation: 88583

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

Upvotes: 2

Related Questions