开发者

How to ignore search through test files

开发者 https://www.devze.com 2023-02-22 08:41 出处:网络
I am using ack and I want to avoid searching through any file which has name test. How do I do that? Following ensures that onl开发者_JS百科y search through files or directory with name test. I want

I am using ack and I want to avoid searching through any file which has name test. How do I do that?

Following ensures that onl开发者_JS百科y search through files or directory with name test. I want reverse of it.

ack foo --rb -G test


ack -G '^(?!test$)'
ack -G '^(?!.*test)'

Use the first one to ignore files named exactly test. Use the second to ignore files with the word test anywhere inside.

If you want to permanently ignore test files you could edit the is_searchable function in the ack script. This is the routine which filters out core dumps, swap files, and the like.

0

精彩评论

暂无评论...
验证码 换一张
取 消