Binary file ‘file_name’ matches

This error occur as a result of some binary values inside the file

[user@staxhost ~]$ grep "create" file.txt
Binary file file.txt matches

Note that you could want this setting if your input file is text, but there are random binary bytes in the middle, for example, due to data corruption or another reason the “binary content” heuristics fails. The purpose of needing to specify this parameter is to prevent mistakenly grepping a binary file and outputting raw binary material to output.

[user@staxhost ~]$ grep -a "create" file.txt
create table 

Leave a Reply