ripgrep Basics/List only file names with matches

Return matching file paths without printing the matching lines.

Section: File discovery and listing

List only file names with matches

bash
bash
rg -l 'useEffect' app/
Explanation

Great for refactors and quick inventories of where an API or symbol appears.

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
List files without matches
Find files that do not contain a pattern.
OpenIn sheetbashsame section
Count matches per file
Show how many matches exist in each file.
OpenIn sheetbashsame section
Count matching lines globally
Suppress file names and count matches across stdin or a small target.
OpenIn sheetbashsame section
Show available built-in file types
Print ripgrep's known type definitions.
OpenIn sheetbashsame section
Search recursively in the current directory
Search for a pattern using ripgrep's recursive defaults.
OpenIn sheetbash1 tag match
Search standard input
Use ripgrep in a pipeline.
OpenIn sheetbash1 tag match