ripgrep (rg) recursively searches the filesystem for a regex pattern. It respects .gitignore by default, skips hidden/binary files sensibly, and is typically much faster than grep -r on large codebases.
# Who calls this function?rg-n'funcName\('-t go# JSON for toolsrg--json'pattern'|head# Replace workflow: list then editrg-l'OldName'|xargs-r sed -i's/OldName/NewName/g'# review first!# Fixed string with special charsrg-F'C++'-t md
Notes & Pitfalls
Default ignore can hide hits in build/, dist/, or gitignored configs—use -u deliberately.
Binary matches are skipped unless unrestricted; good for speed, surprising for firmware blobs.
Multiline requires -U / --multiline (see man).
grep is still required for POSIX scripts and tiny systems without rg.
2026-relevant notes
rg + fd is the standard modern search pair; IDEs shell out to similar engines.
For huge monorepos, prefer type/glob filters over unconstrained -uuu.
PCRE2 (-P) is optional at build time—don’t assume it on every distro build.