ripgrep
Fast recursive text search tool
TLDR
Search pattern
SYNOPSIS
rg [-i] [-t type] [-C num] [options] pattern [path]
DESCRIPTION
ripgrep (rg) is a line-oriented search tool that recursively searches directories for regex patterns, optimized for speed through a Rust implementation and parallel directory traversal. It is typically several times faster than traditional grep, ag, or ack for searching large codebases.
Smart defaults make it productive out of the box: it automatically respects .gitignore rules, skips binary files and hidden directories, and provides colored output with line numbers. These defaults eliminate the need for complex exclude patterns that are common with recursive grep usage. The --hidden flag includes hidden files, and -u flags progressively disable filters for unrestricted searching.
Ripgrep supports full Unicode-aware regex syntax, PCRE2 patterns via -P, literal string matching with -F, and word boundary matching with -w. File type filters (-t) cover dozens of common programming languages and can be customized.
PARAMETERS
-i
Case insensitive.-t TYPE
File type filter.-C NUM
Context lines.-l
List files only.-c
Count matches.-F
Fixed strings.--hidden
Search hidden files.-g GLOB
Glob filter.-w
Word boundaries.
CAVEATS
Different from grep. Some options renamed. Regex syntax varies.
HISTORY
ripgrep was created by Andrew Gallant in 2016. It combines speed with smart defaults, becoming a popular grep alternative.
