What is this?
ripgrep (rg) is a line-oriented command-line tool that recursively searches directories for a regex pattern, automatically respecting .gitignore rules and skipping hidden and binary files by default.
Is this a CLI tool or a library?
It's a standalone command-line binary called rg, not a library — it's built on top of Rust's regex library but used as a search utility from your shell.
How do I install ripgrep?
Download a precompiled binary for Windows, macOS or Linux, or install through your package manager — Homebrew, MacPorts, Chocolatey, Scoop, Winget, pacman, apt, Nix and many others all have official packages.
When should I stick with plain grep instead?
If you need a portable, POSIX-standard tool available on every machine, grep is still the safer bet since ripgrep isn't ubiquitous and doesn't follow POSIX; its default regex engine also lacks look-around and backreferences unless you enable PCRE2.
How much faster is ripgrep than grep or ag?
In the README's own benchmark on the Linux kernel source, ripgrep found a word-boundary pattern in 0.082s versus 0.443s for The Silver Searcher and 2.670s for Unicode-aware GNU grep — roughly 5x to 30x+ faster depending on the case.
Can ripgrep search inside compressed files?
Yes, the -z/--search-zip flag lets it search files compressed with brotli, bzip2, gzip, lz4, lzma, xz or zstandard.
Does ripgrep support advanced regex features like lookahead?
Not by default — its built-in Rust regex engine trades features for speed, but the -P/--pcre2 flag switches to the PCRE2 engine, which adds look-around and backreference support.
Why is ripgrep so fast?
It's built on Rust's finite-automata regex engine with SIMD and literal optimizations, uses a lock-free parallel directory iterator, and automatically chooses memory-mapped or buffered search depending on whether it's scanning one file or a whole tree.
Which topics is it in?
grep, regex, compression, unix, package-manager, systems-programming, search, high-performance, homebrew, cli-tool, command-line, utility