DDevLogTechnical writing
Tools

ripgrep: why it replaced plain grep for me

September 15, 2026

ripgrep is a line-oriented search tool for finding text in codebases. You invoke it as rg, hand it a pattern, and it recursively searches the current directory. Written in Rust by Andrew Gallant and first released in 2016, it became popular for one reason above all: speed. Its author wrote a benchmark post titled "ripgrep is faster than grep, ag, git grep, ucg, pt, sift", and the reputation stuck because the tool backs it up. A new major version, 14, shipped in November 2023, and it remains under active development.

What makes it different

The headline feature is that it respects your ignore files. By default ripgrep reads .gitignore rules, so it skips node_modules, build output, and vendored code the way git would, rather than scanning everything and making you filter the noise. It also skips hidden files and binary files automatically. That is the difference between searching your project and searching everything on disk.

Install it and check the version:

rg --version

On Debian and Ubuntu you can install it with the distro package:

sudo apt install ripgrep

It is also available through Homebrew on macOS, and as a binary download from the project's GitHub releases.

Everyday searching

Once installed, the basics are familiar if you know grep.

rg "def authenticate" src/        # search a directory
rg -i "timeout" .                # case-insensitive, whole tree
rg -n "TODO|FIXME" src           # line numbers with matches
rg -c "password" config          # count matches per file

Output is colorized when it goes to a terminal, and it prints file names and line numbers by default, which is what you want when dredging through a codebase.

The flags that matter

-l lists only the names of files with matches, useful when you care which files, not which lines:

rg -l "api_key" .

--hidden includes hidden files. --no-ignore ignores the ignore rules if you really want every file searched. For case-insensitive search use -i, and -w matches whole words so rg -w run does not match "runner". Context lines help when reading results in place:

rg -C 3 "unhandled" src          # 3 lines before and after

Why it beats grep for code

The honest comparison is that ripgrep is not always "better" than grep in every situation; grep is installed everywhere and is the right tool when you cannot install anything. But for searching a real codebase, ripgrep's advantages add up. It is faster because it is single-pass and fully parallel over multiple cores. It respects version control ignores automatically, so results are clean. And it stays out of your way, printing exactly what a developer searching their own project wants.

If you find yourself grepping node_modules or wading through .git noise again, switch to rg. The mental model is identical to grep, and the wins are immediate: less noise and much less waiting.

← More Tools