rg

rg

TLDR

Recursively search the current directory for a regular expression

$ rg [regular_expression]
copy

Search for regular expressions recursively in the current directory, including hidden files and files listed in .gitignore

$ rg --no-ignore --hidden [regular_expression]
copy

Search for a regular expression only in a certain filetype (e.g., html, css, etc.)

$ rg --type [filetype] [regular_expression]
copy

Search for a regular expression only in a subset of directories

$ rg [regular_expression] [set_of_subdirs]
copy

Search for a regular expression in files matching a glob (e.g., README.*)

$ rg [regular_expression] --glob [glob]
copy

Only list matched files (useful when piping to other commands)

$ rg --files-with-matches [regular_expression]
copy

Show lines that do not match the given regular expression

$ rg --invert-match [regular_expression]
copy

Search a literal string pattern

$ rg --fixed-strings -- [string]
copy

Copied to clipboard
Dodo Farming