I have some big files that I have changed into standardized form, removing line breaks. I want to speed up greps on those files. I know that you can optimize grep by doing grep 'partofpattern' | grep -E 'partofpattern [[:digit:]]+' -- that is, have grep search for lines that contain a more simple part of a pattern and then have grep run a second time on the few lines that contain part of the pattern. That makes me think that grep somehow works line-by-line. So will adding line breaks to big files with no line breaks speed up grep?
Will grep go faster with line breaks?
grep;performance