Why is a file changed to 'UTF-8 Unicode (with BOM) text' format?

Solution Unverified - Updated -

Issue

Found that /etc/hosts file was changed to the format 'UTF-8 Unicode (with BOM) text' from ASCII text.
Is this why?

$ file /etc/hosts
/etc/hosts: UTF-8 Unicode (with BOM) text, with CRLF, LF line terminators

$ cat /etc/hosts
<U+FEFF>127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

Environment

  • Red Hat Enterprise Linux

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