Find BOM

|   Linux/UNIX | BashShellLinuxUTF-8

Find all files with Byte Order Marks (BOM)

The following code find all files with a Byte Order Mark (BOM) and collects the filepaths in a separated file.

When you find "" in the beginning of your source code you have a BOM problem.

grep -r --include=*.php -l $'\xEF\xBB\xBF' . >> /tmp/bomcollection.txt