Sample Header Ad - 728x90

ripgrep: print only filenames matching pattern

78 votes
1 answer
58496 views
Using [ripgrep (rg)](https://github.com/BurntSushi/ripgrep) , can I print only the filenames which match a given pattern? There are two separate things I'm trying to do: 1. Match the pattern to the pathname itself (like ag -g pattern) 1. Match the pattern to the contents of the file and print only the filename I can't work out how to do either one.
Asked by Tom Hale (32922 rep)
Jul 3, 2018, 09:25 AM
Last activity: Dec 3, 2021, 10:10 AM