Using ripgrep (rg
), can I print only the filenames which match a given pattern?
There are two separate things I'm trying to do:
- Match the pattern to the pathname itself (like
ag -g pattern
) - Match the pattern to the contents of the file and print only the filename
I can't work out how to do either one.
--max-count 1
– BallpointBen Jun 23 '21 at 20:02