At the very least ag does not handle large files. It bails with an error after the file gets too big.
But that should go away by streaming the file. e.g.
cat haystack | ag 'Needle' ag Needle < haystack
No need for catPipes are a good tool, and so are many others. Having a good command of other basic mechanisms of the shell is going to hugely pay off, try to have a brief shot if you want [0].
[0] https://www.gnu.org/software/bash/manual/html_node/Redirecti...
grep needle haystack
Surely grep needle < haystack
is much closer to that form than cat haystack | grep needleWill work too, and now it's in the logical order.