Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

linux find and remove bom from files

sed '1s/^xEFxBBxBF//' < orig.txt > new.txt
You can also overwrite the existing file with the -i option:

sed -i '1s/^xEFxBBxBF//' orig.txt
If you are using the BSD version of sed (eg macOS) then you need to have bash do the escaping:

 sed $'1s/xefxbbxbf//' < orig.txt > new.txt
Source by unix.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #linux #find #remove #bom #files
ADD COMMENT
Topic
Name
6+8 =