Quantcast
Viewing all articles
Browse latest Browse all 6038

Ignoring folders in The Silver Searcher `ag`

I have a structure like this:

folder_a/├── a.txt└── folder_b/└── b.txt

where both text files contain 1234 string. Being in folder_a how to use ag from terminal to find only a.txt?

I tried:

  • ag -Qu "1234" --ignore folder_b .
  • ag -Qu "1234" --ignore-dir folder_b .
  • ag -Qu "1234" --ignore-dir={folder_b,} .

and always got

a.txt1:1234folder_b/b.txt1:1234

How to ignore/exclude directory folder_b from the search?


Viewing all articles
Browse latest Browse all 6038

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>