Linux: Remove Byte-Order-Mark (BOM) from files

Oh no there are BOMs in your files! No not BOMBS, BOMs. These sometimes are accidentally added by some IDEs depending on how the settings are configured. One easy way of removing them is this.

First lets find all these BOMs. This will recursively find any files(excluding binary) and list only those having a BOM

grep -rlI $'\xEF\xBB\xBF' . 

If you find any files you might want to de-BOM then pip the output through xargs and vim to remove it

grep -rlI $'\xEF\xBB\xBF' . | xargs vim -c "set nobomb" -c wq!

And just like that all BOMs are gone.