Show how many matches exist in each file.
Section: File discovery and listing
Count matches per file
bash
bash
rg -c 'console\.log' src/Explanation
Good for estimating cleanup scope before refactors.
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 File discovery and listing
Count matching lines globally
Suppress file names and count matches across stdin or a small target.
List only file names with matches
Return matching file paths without printing the matching lines.
Show available built-in file types
Print ripgrep's known type definitions.
Search recursively in the current directory
Search for a pattern using ripgrep's recursive defaults.