views:

14

answers:

2

I use ack and I like it.

However from time to time I need to search for something in my code base and I want to ignore all the files residing in test directory. Basically all the files which have test in their absolute path should be not included in the search.

How do I achieve that?

I am willing to have a custom bash script. Something like

ack_no_test "application" -> search for "application" in all files but ignore files residing in test directory

A: 

one could add "test" to the "repodirs" var in findrepo.

Personally I think ack to too complicated/slow and "non unixy", as it doesn't reuse the existing unix toolkit.

pixelbeat
+1  A: 

From man ack:

--[no]ignore-dir=DIRNAME
Ignore directory (as CVS, .svn, etc are ignored). May be used multiple times to ignore multiple directories. For example, mason users may wish to include --ignore-dir=data. The --noignore-dir option allows users to search directories which would normally be ignored (perhaps to research the contents of .svn/props directories).

Dennis Williamson
this is beyond embarrasing. I looked at ack help but looks like I missed this one. thanks mate.
Nadal