Performance, Debugging, and Multiline Search/Reduce search scope with types

Search fewer files for faster results.

Section: Performance patterns

Reduce search scope with types

bash
bash
rg -t py 'dataclass' .
Explanation

Targeting the right file types can cut search time dramatically in large monorepos.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Performance patterns
Prefer literal search when possible
Use fixed strings for maximum speed.
OpenIn sheetbashsame section
Stop after a few matches
Limit results to inspect representative hits.
OpenIn sheetbashsame section
Stay on one filesystem
Avoid crossing mount boundaries.
OpenIn sheetbashsame section
Tune the number of worker threads
Control ripgrep parallelism explicitly.
OpenIn sheetbashsame section
Inspect filtering decisions
Show diagnostics about ignores, globs, and traversal.
OpenIn sheetbash1 tag match
Search across line boundaries
Allow regex matches to span multiple lines.
OpenIn sheetbash1 tag match