Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2021 02:19
What would you like to do?
Ripgrep ignore/exclude files that match a certain string

Say you want to search for a certain string, but exclude files which match another pattern.


rg $PATTERN_TO_FIND --stats $(rg $PATTERN_TO_EXCLUDE --files-without-match $DIR_TO_SEARCH)

A files which does contain "good regex" will be matched, unless it also contains "bad regex".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment