talira

Searches directories recursively for a regex pattern, skipping gitignored files

open sourceUnlicenseself-hostablefree

ripgrep (rg) is a line-oriented search tool that recursively searches the current directory for a regex pattern. By default it respects gitignore rules and skips hidden files, directories and binary files, which makes it far faster and less noisy than grep in code repositories. It has first-class support for Windows, macOS and Linux and ships as a single binary.

Ways to install

Problems it solves

  • grep -r takes forever on my repo because it searches node_modules and build output
  • search every file in a project for a regex but skip anything in .gitignore
  • my code search results are full of matches from minified bundles and binary files
  • I want a much faster way to find where a function is called across a huge codebase
  • grep -rn | grep -v is getting ridiculous just to exclude vendor folders
  • find all TODO comments in the codebase quickly from the terminal
  • need a recursive text search that works the same on Windows, Mac and Linux
  • searching the Linux kernel source for a pattern takes too long
  • search only Python files for a regex without writing a find | xargs pipeline
  • need JSON output of search matches so a script or editor can consume them

Features

  • respects .gitignore by default
  • skips hidden and binary files
  • file type filters
  • PCRE2 support
  • search compressed files
  • JSON output
  • config file
  • replacement output

Capabilities

Has a command line toolplan not known

Alternatives

The same job

These do what ripgrep does.

  1. The Silver Searcher A code-searching tool similar to ack, but faster
  2. fd A simple, fast and user-friendly alternative to 'find'
  3. Renamify Smart search & replace for code and files with case-aware transformations and built-in undo/redo
  4. ast-grep A CLI tool for code structural search, lint and rewriting

Compare ripgrep with the top 3