grep 返回 Binary file (standard input) matches

grep 返回 Binary file (standard input) matches

July 20, 2020

grep “keyword” xxx.log时输出: Binary file (standard input) matches

这个是因为grep命令认为它是一个二进制文件。解决方案是,加上一个参数 -a:

grep -a "keyword" xxx.log

该参数的解释:

-a, --text    equivalent to --binary-files=text
最后更新于