Restrict search by glob.
Section: ripgrep (rg)
Search only specific file types
bash
bash
rg -g '*.ts' 'useEffect' src/Explanation
Globs help narrow large code searches to relevant files.
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 ripgrep (rg)