Skip to content

Instantly share code, notes, and snippets.

@alpody
Last active June 20, 2016 06:44
Show Gist options
  • Save alpody/1e64ce3304e3f1719f65419561446edd to your computer and use it in GitHub Desktop.
Save alpody/1e64ce3304e3f1719f65419561446edd to your computer and use it in GitHub Desktop.
Find file with bom and remove BOM from the files
grep -rl $'\xEF\xBB\xBF'
# remove file with bom
# if remove .bak then sed not create backup
find . -type f -exec sed '1s/^\xEF\xBB\xBF//' -i.bak {} \; -exec rm {}.bak \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment