【发布时间】:2021-10-19 01:15:23
【问题描述】:
我需要递归查找所有包含以下 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">'
我做错了什么?
【问题讨论】:
-
grep一次处理文件一行,不能进行多行匹配。