tl;dr; ripgrep (aka.
rg) 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
git grep whenever I was inside a git repo and
sift for everything else. That alone, was a huge step up from regular
grep. Granted, almost all my git repos are small enough that regular
git grep is faster than I can perceive many times. But with
ripgrep I can just add
--no-ignore-vcs and it searches in all the files mentioned in
.gitignore too. That's useful when you want to search in your own source as well as the files in
The installation instructions 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 type gets some getting used to (tip! use:
rg --type-list) and remember that you can pipe
rg output to another
rg. For example, to search for all lines that contain
string you can use
rg query | rg string.