I've got a list of files that I would like to search for a pattern with ripgrep.
How can this be done?
I've got a list of files that I would like to search for a pattern with ripgrep.
How can this be done?
ripgrep accepts file paths as arguments. So just pass your files as arguments:
rg pattern file1 file2 ...
If your list is in a file, with one path per line, then use xargs:
xargs -d '\n' -a list-file rg pattern
Or if it's a list generated from find, then:
find ./ ... -print0 | xargs -0 rg pattern