ack: Excluding only one directory but keeping all others with the same name

Posted by mattalexx on Stack Overflow See other posts from Stack Overflow or by mattalexx
Published on 2010-05-09T23:26:31Z Indexed on 2010/05/09 23:38 UTC
Read the original article Hit count: 322

Filed under:

My folder structure looks like this:

/app
/app/data
...
/app/secondary
/app/secondary/data

I want to recursively search /app, including /app/data. I do not want to search /app/secondary/data however. This what I have so far:

ack --ignore-dir=data searchtext
ack --ignore-dir=secondary/data searchtext

The first command is ignoring both directories and the second one is ignoring neither of them. From within the app folder, what should my ack command look like?

© Stack Overflow or respective owner

Related posts about ack