grep outputs "binary file matches" for non UTF-8 encoding text files in RHEL 8 or later
Issue
- Non UTF-8 encoding (such as SJIS) text files are treated as binary files by
grepin RHEL 8 or later. -
RHEL 8
grepdetect some files as binary files For example,/etc/udev/hwdb.binwhich were treated as text files in RHEL 7grep.$ grep LANG /etc/udev/hwdb.bin grep: /etc/udev/hwdb.bin: binary file matches
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
- grep
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.