Linux найти и удалить BOM из файлов
sed -i '1s/^\xEF\xBB\xBF//' orig.txt
Tiago F2
sed -i '1s/^\xEF\xBB\xBF//' orig.txt
sed $'1s/\xef\xbb\xbf//' < orig.txt > new.txt
sed '1s/^\xEF\xBB\xBF//' < orig.txt > new.txt
sed '1s/^\xEF\xBB\xBF//' < orig.txt > new.txt
You can also overwrite the existing file with the -i option:
sed -i '1s/^\xEF\xBB\xBF//' orig.txt
If you are using the BSD version of sed (eg macOS) then you need to have bash do the escaping:
sed $'1s/\xef\xbb\xbf//' < orig.txt > new.txt