How do I use ag to look for text in files with certain extensions?
71
votes
2
answers
44507
views
I'm using
ag
(The Silver Searcher ) version 0.31.0. I can easily look for a string in a bunch of files using:
localhost:workspace davea$ ag 'ftp' .
But what if I only want to scan files with certain extensions? I tried this:
localhost:workspace davea$ ag 'ftp' .java
ERR: Error stat()ing: .java
ERR: Error opening directory .java: No such file or directory
but got the errors you see above.
Asked by Dave
(2808 rep)
Feb 8, 2017, 09:11 PM
Last activity: Sep 16, 2019, 07:54 PM
Last activity: Sep 16, 2019, 07:54 PM