Ubuntu Windows 上的 grep 未找到所有条目
Ubuntu grep on Windows does not find all entries
我已经将一堆 MS-Outlook 邮件导出到一个文本文件中。现在我试图在该文本文件中找到一些特定的行,但这似乎不起作用:
Prompt>/C/Temp_Folder$ egrep "Found crash|process disappearance " testtttt.txt | wc -l
13
Prompt>/C/Temp_Folder$ grep "Found crash" testtttt.txt | wc -l
11
Prompt>/C/Temp_Folder$ grep "process disappearance " testtttt.txt | wc -l
3
在 Notepad++ 中打开此文件,得到以下结果:
Found crash : 921 matches
process disappearance : 4975 matches
这可能很有趣:
当我在没有 wc -l
的情况下启动 grep
时,我在最后看到以下结果:
Binary file testtttt.txt matches
这可能意味着该文件被视为二进制文件,尽管它只是一个 "regular" 文本文件。
当我询问我正在处理哪种文件时,我得到以下结果:
file testtttt.txt
testtttt.txt: news or mail, ISO-8859 text, with very long lines, with CRLF line terminators
这是怎么回事:是 news or mail
、ISO-8859
、very long lines
、...,我该如何解决这个问题?
为了您的理解,我正在 Windows-10 机器上开发 Linux 子系统(来自 Canonical Group Limited
的 Ubuntu 应用程序)。
我设法使用 Notepad++ 功能解决了我的问题 Find all in current document
。
我已经将一堆 MS-Outlook 邮件导出到一个文本文件中。现在我试图在该文本文件中找到一些特定的行,但这似乎不起作用:
Prompt>/C/Temp_Folder$ egrep "Found crash|process disappearance " testtttt.txt | wc -l
13
Prompt>/C/Temp_Folder$ grep "Found crash" testtttt.txt | wc -l
11
Prompt>/C/Temp_Folder$ grep "process disappearance " testtttt.txt | wc -l
3
在 Notepad++ 中打开此文件,得到以下结果:
Found crash : 921 matches
process disappearance : 4975 matches
这可能很有趣:
当我在没有 wc -l
的情况下启动 grep
时,我在最后看到以下结果:
Binary file testtttt.txt matches
这可能意味着该文件被视为二进制文件,尽管它只是一个 "regular" 文本文件。
当我询问我正在处理哪种文件时,我得到以下结果:
file testtttt.txt
testtttt.txt: news or mail, ISO-8859 text, with very long lines, with CRLF line terminators
这是怎么回事:是 news or mail
、ISO-8859
、very long lines
、...,我该如何解决这个问题?
为了您的理解,我正在 Windows-10 机器上开发 Linux 子系统(来自 Canonical Group Limited
的 Ubuntu 应用程序)。
我设法使用 Notepad++ 功能解决了我的问题 Find all in current document
。