Search recursively in the current directory
Search for a pattern using ripgrep's recursive defaults.
rg TODO.ripgrep searches recursively from the current directory, respects ignore files, and skips hidden and binary files by default.
Core `rg` searches for files, code, and text with line numbers, smart defaults, and recursive search behavior.
Start with the most common rg patterns used in code and text search.
Search for a pattern using ripgrep's recursive defaults.
rg TODO.ripgrep searches recursively from the current directory, respects ignore files, and skips hidden and binary files by default.
rg FIXME src/Useful when you know the subsystem or package you want to inspect.
rg -n 'apiKey' config/ripgrep usually shows line numbers for multi-file searches, but `-n` makes the intent explicit and is handy in aliases/scripts.
rg -i 'authorization' .Helpful for logs, prose, and inconsistent capitalization.
Lowercase patterns search case-insensitively; uppercase triggers case-sensitive search.
rg -S 'userId' src/`-S` is a popular default because it reduces missed matches while still preserving intentional case-sensitive searches.
Use rg to identify matching files, counts, and quick inventories before opening an editor.
Return matching file paths without printing the matching lines.
rg -l 'useEffect' app/Great for refactors and quick inventories of where an API or symbol appears.
rg -L 'Copyright 2026' .Useful for cleanup tasks such as adding headers or spotting configs missing a required key.
rg -c 'console\.log' src/Good for estimating cleanup scope before refactors.
Suppress file names and count matches across stdin or a small target.
rg -c 'ERROR' app.logFor multi-file totals, pair with shell tools such as `awk` or use JSON output for scripting.
rg --type-list | lessType filters are one of ripgrep's biggest productivity boosts in mixed-language repositories.
Search streamed data from other shell commands or logs.
git diff --cached | rg '^\+'ripgrep works well in shell pipelines, not just on files in a directory tree.
Filter live or recent command output with rg.
journalctl -u nginx --since today | rg -i 'timeout|error'A fast way to sift through logs without saving them to disk first.
Use another command to produce candidate text and rg to filter it.
fd . src | rg '/tests?/'ripgrep is often the second stage in command pipelines.
Search data that uses NUL delimiters instead of newlines.
printf 'alpha\0beta\0gamma\0' | rg -z 'beta'`-z` is helpful when working with filenames or generated data that uses NUL separators.
Use structured output for editor integrations and automation.
rg --json 'panic!' src/JSON output is ideal when a script or UI needs precise match spans and file metadata.