Quantcast
Channel: ripgrep: print only filenames matching pattern - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 2

ripgrep: print only filenames matching pattern

$
0
0

Using ripgrep (rg), 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)
  2. Match the pattern to the contents of the file and print only the filename

I can't work out how to do either one.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>