rg有什么参数可以只列出文件路径吗?

rg有什么参数可以只列出文件路径吗?

⋊>  man rg | rg 'Only.*paths' -C2

       -l, --files-with-matches
           Only print the paths with at least one match.

           This overrides --files-without-match.

       --files-without-match
           Only print the paths that contain zero matches. This
           inverts/negates the --files-with-matches flag.

1 个赞

用这个 --files-with-matches 参数可以,多谢