Daily Archives: February 23, 2016

Grep picking up HTML (text) file as a binary file

For some reason, grep, thought that a “HTML document, Non-ISO extended-ASCII text, with very long lines” was a binary, so refused to print contents.

TIL about -a. In grep, -a tells grep to process a binary file as if it were text. This means, if grep incorrectly thinks a file is binary, it’ll still work with it.

That cost me at least 2 hours of scratching my head, wondering why my regex wasn’t working as it should…