首页 > 解决方案 > 如何使用引号和回车符 grep 长 html 字符串

问题描述

我需要递归查找包含以下 HTML 的所有文件:

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

我正在尝试以下但没有成功:

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">'

我究竟做错了什么 ?

标签: linuxgrep

解决方案


使用 GNU grep。删除和添加。-F_-n"/path-to-dir"-Poz


推荐阅读