linux下grep日志文件报错Binary file matches

原因:被grep的目标文件被识别为二进制文件了

解决方法:

(1)转化为字符串;

命令:strings access.log | fgrep ERROR

(2)将二进制视为文本;

命令:grep -a ERROR access.log

评论关闭。