Grep命令出现 Binary file (standard input) matches

在执行 tail -fn100 error.log | grep 'code been'命令时会出现 Binary file (standard input) matches的提示,说明系统把grep的输入当成一个二进制文件了,解决办法:
tail -fn100 error.log | grep -a 'code been'即可。

-a: 把二进制文件当成普通文本,效果和--binary-files=text

猜你喜欢

转载自www.cnblogs.com/rookie-test/p/12684263.html