ack: Exclude specific directories from search via regex

后端 未结 4 885
小蘑菇
小蘑菇 2021-02-01 16:31

How do I ignore specific directories via RegEx with ack?

I can use the --ignore-dir option, but this does not let me specify a RegEx. I want to be able to i

4条回答
  •  你的背包
    2021-02-01 17:12

    With ack2, it seems you can't use holygeek's solution.

    Here's how I'd do it using -v and -x:

    ack -v -g 'test' | ack -x pattern
    

    More generally, 'test' can be a regex for dirs to exclude

提交回复
热议问题