ACK: exclude certain paths (directory and its subdirectories) from search
With ACK 2.x , I can specify command line options to exclude specific drives from being displayed in the results. For example, to exclude the 'test' directory I can use :
ack -v -g 'test' | ack -x pattern
('test' can be a regex for exceptions for dirs)
I can also ignore the directory using .ackrc by adding --ignore-dir=save.d
to .ackrc or using it as a command line parameter. But it seems that I cannot exclude the paths (registry and its subdivisions) using RegEx. I tried to add the following:
--ignore-dir=match:^\/specific\/path\/to\/test\/.*$
as well as the following options
--ignore-dir=match:/^\/specific\/path\/to\/test\/.*$/
--ignore-dir=match:\/specific\/path\/to\/test\/.*
--ignore-dir=match:/specific/path/to/test/.*
--ignore-dir=match:/specific/path/to/test/
(as per this user - ignore-dir and -ignore-file, and indeed, all file matching in ack is done with regex, not with shell shell patterns , but I've also tried using shell shell patterns.)
but this gives me:
Non-is filters are not yet supported for --ignore-dir at /usr/bin/ack line 157
Outputting the "match:" part of the alternatives above does not result in an error, but neither does dirs.
source to share
This is not supported, I'm afraid. Cm
- ignore-dir does not support absolute paths * Issue # 291 petdance / ack2
I came to this post for something similar and found the above question ...: - (
source to share