Thursday, January 05, 2012

fgrep MAN Page

fgrep MAN Page: "fgrep

Search file(s) for lines that match a fixed string

Syntax
fgrep ...

fgrep is the same as `grep -F'

all other options are the same as grep
It's a popular fallacy that fgrep stands for fast-grep, in fact fgrep means fixed-string grep.

fgrep implements the Aho–Corasick string matching algorithm which is very fast at matching multiple strings in the input stream/file. So if fgrep is used like this:

fgrep -f patternlist.txt largetextfile.txt

it is much faster than

grep -f patternlist.txt largetextfile.txt

Matching a single pattern with fgrep is not significantly faster than grep.

"The knowledge imposes a pattern, and falsifies, For the pattern is new in every moment..." - T. S. Eliot"

'via Blog this'

No comments:

Post a Comment