The best grep tool in the world; ripgrep
tl;dr; ripgrep (aka.
) is the best tool to grep today.
For both searching single files and huge directories of files, no other tool obviously stands above ripgrep in either performance or correctness .
ripgrep is the only tool with proper Unicode support that doesn’t make you pay dearly for it.
Tools that search many files at once are generally slower if they use memory maps, not faster.
I used to use
whenever I was inside a git repo and
for everything else. That alone, was a huge step up from regular
. Granted, almost all my git repos are small enough that regular
is faster than I can perceive many times. But with
I can just add
and it searches in all the files mentioned in
too. That's useful when you want to search in your own source as well as the files in
are easy. I installed it with
brew install ripgrep
and the best way to learn how to use it is
. Remember that it has a lot of cool features that are well worth learning. It's written in Rust and so far I haven't had a single crash, ever. The ability to search by file
gets some getting used to (tip! use:
) and remember that you can pipe
output to another
. For example, to search for all lines that contain
you can use
rg query | rg string