Skip to content

Ignoring files matching a pattern? #2156

Answered by BurntSushi
omentic asked this question in Q&A
Discussion options

You must be logged in to vote

First I'll just comment directly on each thing you attempted, then I'll try to explain the unfortunate state of affairs today.

rg search / --iglob /timeshift/*

So if you're trying to ignore things in /timeshift, then this definitely won't work because this is specifically asking ripgrep to only search things inside of /timeshift. In order to negate a glob, you need to use !. So, in this case, --iglob '!/timeshift/*'. Note that the single quotes are important! (However, this probably still doesn't work for you.)

rg search / --ignore-file ignore (where ignore is a file containing /timeshift/*)

This is almost right, but as the docs say, --ignore-file is applied relative to the current wo…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@seriiserii825
Comment options

@BurntSushi
Comment options

@urev
Comment options

Answer selected by omentic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants