Translated message

A translation of this page exists in English.

RHEL 8 以降で grep が UTF-8 以外のエンコーディングのテキストファイルに対して "binary file matches" を出力する

Solution In Progress - Updated -

Issue

  • RHEL 8 以降では、UTF-8 以外のエンコーディング (SJIS など) のテキストファイルが、grep によってバイナリーファイルとして扱われます。
  • RHEL 8 grep は、一部のファイル (たとえば RHEL 7 grep ではテキストファイルとして扱われていた /etc/udev/hwdb.bin など) をバイナリーファイルとして検出します。

    $ 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content