Fuzzy text searches with agrep
Better Finds
© Lead Image © 3dalia, 123RF.com
The agrep tool expands on grep by adding fuzzy search capabilities to text string-matching operations.
The grep command, which allows users to find strings and patterns in text files, is probably familiar to Linux users who use the command line; however, its variants are less well known. For example, the following two commands are precisely equivalent:
egrep <term> <file(s)> grep -e <term> <file(s)>
The tool interprets the <term> as an extended regular expression. By contrast, fgrep interprets this as being equivalent to grep -f, where all components in <term> are normal characters, thus ignoring their potential regex meanings. It thus works a little faster than a plain vanilla grep, and this is especially noticeable when searching large volumes of data. A third candidate, rgrep, works like grep -r, recursively parsing folder structures, which affects its speed. All these commands have one thing in common: They only find direct hits for <term>; a search for similar terms only works if you design a matching regex.
[...]
Buy this article as PDF
(incl. VAT)
