Searching a codebase is something you do dozens of times an hour, so the speed of the tool that does it quietly shapes your whole day. ripgrep (rg) is the tool that reset expectations here: a Rust-built recursive search that's dramatically faster than grep and, just as importantly, smarter by default - it respects your .gitignore, skips binary files and hidden directories, and searches only the code you actually care about without you asking.
Fast, and Sensible by Default
The speed is the headline, but the defaults are what make it pleasant. You point it at a directory (or nothing, meaning the current one) and it does the obviously-right thing:
# Search recursively from here
rg TODO
# Only in Python files, show 2 lines of context
rg --type py --context 2 "def process"
# Search everything, including ignored/hidden files
rg -uu "api_key"
Built to Compose
ripgrep prints results in a format editors and other tools understand, which is why it's become the search engine embedded inside so many editors and tools. Full regex, Unicode support, replacement previews, and file-type filters are all there when you need them.
Rough Edges and Limitations
- Its smart defaults can hide files. When a result seems missing, it's usually because a file is gitignored - reach for
-u/-uu. - It's a searcher, not an editor. For find-and-replace across files, pair it with a tool like sd.
- Regex flavor differs slightly. It's Rust's regex engine, so a handful of PCRE features need the
-Pflag.
Install it once and grep starts to feel like a relic. It's the CLI upgrade with the highest daily payoff on this whole list.
Internal link suggestion: link "embedded inside so many editors" to the fzf post - the two pair constantly in shell workflows.