ripgrep (the rg command) has become the default code-search tool for a generation of developers, and for good reason: it is dramatically faster than grep -r, and it skips the noise. By default it ignores hidden files, binary files, and anything listed in .gitignore, so searching a repository returns relevant hits instead of thousands of matches buried in node_modules.

bash
rg --type py "def\s+main" src/

This finds Python function definitions named main only inside .py files under src/. The --type filter is built from a large set of language presets, and you can add your own. ripgrep supports full PCRE2 regex with -P, replacement previews with -r, and JSON output with --json for tooling. Its speed comes from a fast regex engine, parallel directory traversal, and memory-mapped reads. Editors like VS Code embed it as their search backend. Whether you are grepping logs, auditing a codebase for a vulnerable call, or building a script, ripgrep is the tool you reach for first.