4 ms·
fgrep is the way to go here. It uses a different algorithm that makes only one pass through the file while searching for all strings simultaneously. An extensio
by cup-of-tea 8y ago
fgrep is the way to go here. It uses a different algorithm that makes only one pass through the file while searching for all strings simultaneously. An extension of trie search.
- kazinator 8y agofgrep is an obsolete command that didn't make it into POSIX. I already mentioned the -F option of grep. "fgrep is the same as grep -F" -- GNU grep man page. I would expect that when the patterns in -f <patternfile> are treated as regular expressions, they are also combined into one regex.
- cup-of-tea 8y agoI know it's the same thing. I prefer the name fgrep because it does do a different thing. I write "grep -F" in scripts, but I say fgrep.