Binary file (standard input) matches


Error code:

$ sudo cat /var/log/syslog | grep "tree"
Binary file (standard input) matches


Solution:

$ sudo cat /var/log/syslog | grep "tree" --text
Jul 14 17:43:00 osboxes kernel: [    3.042582] vboxguest: loading out-of-tree module taints kernel.
Jul 15 13:24:47 osboxes kernel: [    3.420002] vboxguest: loading out-of-tree module taints kernel.
Jul 15 13:54:22 osboxes kernel: [    3.027623] vboxguest: loading out-of-tree module taints kernel.
Sep 28 12:59:21 osboxes kernel: [    3.165531] vboxguest: loading out-of-tree module taints kernel.
Sep 28 13:46:04 osboxes kernel: [    2.755048] vboxguest: loading out-of-tree module taints kernel.
Sep 28 13:51:08 osboxes kernel: [    3.508174] vboxguest: loading out-of-tree module taints kernel.
Oct 19 21:04:41 osboxes kernel: [    2.762903] vboxguest: loading out-of-tree module taints kernel.
Oct 19 21:11:51 osboxes kernel: [    2.566860] vboxguest: loading out-of-tree module taints kernel.

This message from grep means it detected non text bytes in the input and, by default, only reports that the binary file matched instead of printing lines. Logs with a few stray binary bytes trigger it.

Adding the --text option, or -a, tells grep to treat the input as text and print the matching lines, which is what you want when searching a mostly text file that contains a few binary characters.

Comments

Popular posts from this blog

[Solved] Error: No such keg: /usr/local/Cellar/gcc

[How To] Unfollow Non-followers on Instagram