Using fuzzy searches with tre-agrep

Choosing tre-agrep

Note that tre-agrep is not a complete replacement for grep. Grep has several options that tre-agrep lacks, including options for defining how directories and binary files are handled, as well as the ability to stop after a set number of results. Such options would be equally useful in tre-agrep.

Still, in typical searches, tre-agrep can be a drop-in replacement for grep, and because its ability to handle regular expressions is roughly equal to grep's, that should not be surprising.

However, what truly sets tre-agrep apart is not only its ability to handle approximations, but the simplicity with which approximations are implemented. Aside from a few basic examples, to get the most from regular expressions requires neither extensive memorization nor frequent consultations with man or web pages. Neither alternative holds much appeal for average users.

By contrast, approximations in tre-agrep usually get results without the need to be familiar with regular expressions. For that reason alone, you might consider tre-agrep as grep's replacement.

The Author

Bruce Byfield is a computer journalist and a freelance writer and editor specializing in free and open source software. In addition to his writing projects, he also teaches live and e-learning courses. In his spare time, Bruce writes about Northwest coast art. You can read more of his work at

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • agrep

    The agrep tool expands on grep by adding fuzzy search capabilities to text string-matching operations.

  • Command Line – Pgrep

    Pgrep is a valuable tool for tracking down processes.

  • Charly's Column: Biabam and Tre-agrep

    Most of the tools that show up in this column are small, smart, fast, and easily explained. This month is no exception; we feature a dynamic duo of tools.

  • Tracked Down

    Searching for text in files or data streams is a common and important function. Ugrep tackles this task quickly, efficiently, and even interactively if needed.

  • ICgrep

    One of the most common tasks when working on computers involves browsing texts for search patterns. Here, ICgrep offers a modern, parallel, and Unicode-enabled alternative to the classic grep.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.