I use Ripgrep as my command-line search tool. Something I often want is to return matching filenames only, instead of Ripgrep’s rich colored output, so I can pipe them to xargs. Here’s that flag:

rg -l

The -l flag is short for the --files-with-matches flag. As an example, today I used it to delete all drafts from a blog project.

rg -l "draft" src/content/posts/ | xargs rm

See man rg for more.