silver searcher ignore multiple directories

Harry Moreno picture Harry Moreno · Apr 13, 2016 · Viewed 10.3k times · Source

using The silver searcher how can I ignore multiple directories?

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

Answer

gylaz picture gylaz · Feb 5, 2018

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,}.