← Software

ripgrep

A fast recursive grep replacement written in Rust.

ripgrep (rg) walks a directory tree and searches each file with regular expressions, automatically respecting .gitignore rules and skipping binary files by default. It is typically several times faster than grep -r and faster than ack, the silver searcher (ag), or pt — the previous generation of grep replacements. The default behaviour matches what most developers actually want when grepping a codebase.

The implementation in Rust uses Andrew Gallant's regex crate, which guarantees worst-case O(m+n) matching even for adversarial inputs (something Python's re or Perl's regex cannot do). The file walker is multithreaded, which lets ripgrep saturate multiple cores on large repositories.

Andrew Gallant wrote ripgrep starting in 2016. It has become the de facto "modern grep" — most code editors that need a grep-style search feature now shell out to ripgrep, and many shell aliases (rg over grep, especially in git checkouts) make it the default for interactive use.

License: MIT OR Unlicense

Category: CLI tools

Website: https://github.com/BurntSushi/ripgrep

Install

Debian/Ubuntu: sudo apt install ripgrep
Fedora/RHEL:   sudo dnf install ripgrep
Arch:          sudo pacman -S ripgrep
macOS:         brew install ripgrep

Authors

  • Andrew Gallant (creator)
Previousrestic Nextrsync

This site is currently in Beta. Contact: Chris Paton

Textbook of AI · Textbook of Usability · Textbook of Digital Health

Auckland Maths and Science Tutoring