`
yuanlanjun
  • 浏览: 1181586 次
文章分类
社区版块
存档分类
最新评论

grep的时候Binary file (standard input) matches 怎么解决?

 
阅读更多

操作

grep "xxx" a.log

结果

Binary file a.log matches

原因:grep认为a.log是二进制文件

解决方法:

grep -a "xxx" a.log

可以看看grep -a参数的功能

[appadmin@test3 ~/tmp]$ grep --help |grep '/-a'
-a, --text equivalent to --binary-files=text

二进制文件等价于文本文件

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics