Bur*_*hi5 14
ripgrep 接受文件路径作为参数。所以只需将您的文件作为参数传递:
rg pattern file1 file2 ...
Run Code Online (Sandbox Code Playgroud)
如果您的列表在一个文件中,每行一个路径,则使用 xargs:
xargs -d '\n' -a list-file rg pattern
Run Code Online (Sandbox Code Playgroud)
或者,如果它是从 生成的列表find
,则:
find ./ ... -print0 | xargs -0 rg pattern
Run Code Online (Sandbox Code Playgroud)