Skip to content

BOM

Check if a file as a BOM:

$ file <file>

This shows for instance:

XML 1.0 document, UTF-8 Unicode (with BOM) text, with very long lines, with CRLF line terminators

To remove BOM from start of file:

$ sed -i $'1s/^\uFEFF//' <file>