45

using The silver searcher how can I ignore multiple directories?

I tried ag foo --ignore-dir dir1,dir2 but it doesn't work.

Harry Moreno
  • 10,231
  • 7
  • 64
  • 116

2 Answers2

55

You an also do this (without needing to repeat the flag):

ag foo --ignore-dir={dir1,dir2}

You need to use this format with more than one directory. Otherwise, if it's with just one directory, you'd need to provide a comma, like: ag foo --ignore-dir={dir1,}.

gylaz
  • 13,221
  • 8
  • 52
  • 58
43

you can specify the argument multiple times

ag foo --ignore-dir dir1 --ignore-dir dir2

Harry Moreno
  • 10,231
  • 7
  • 64
  • 116