Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5944

Ignoring folders in The Silver Searcher `ag`

$
0
0

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 5944

Trending Articles