Ignoring files matching a pattern? #2156
-
Hi, I've been trying unsuccessfully to get ripgrep to ignore some files while searching through my hard drive (in this case, files under I think I'm missing something obvious - but I've tried everything I could find in the manual.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
First I'll just comment directly on each thing you attempted, then I'll try to explain the unfortunate state of affairs today.
So if you're trying to ignore things in
This is almost right, but as the docs say,
There should be zero docs suggesting that this would work how you expect it to.
Same as above. OK, so the main problem here is that ripgrep uses gitignore match semantics everywhere, including in the If changing your CWD isn't something you want to do, then I believe your only other choice is to drop a Now ideally, the |
Beta Was this translation helpful? Give feedback.
First I'll just comment directly on each thing you attempted, then I'll try to explain the unfortunate state of affairs today.
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.)This is almost right, but as the docs say,
--ignore-file
is applied relative to the current wo…