If you're not sure whether the file contains a BOM or not: awk '{if(NR==1)sub(/^\xef\xbb\xbf/,"");print}' text.txt If you know the file definitely contains a 4-byte BOM: tail --bytes=+4 text.txt