I'm using ag 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' .javaERR: Error stat()ing: .javaERR: Error opening directory .java: No such file or directorybut got the errors you see above.
How do I use ag to look for text in files with certain extensions?
files;search;ag
Per the manual, you could use ag with -G    -G --file-search-regex PATTERN          Only search files whose names match PATTERN.e.g.ag -G '\.java$' 'ftp' .Per the same manual   It is possible to restrict the types of files searched [...]   For a list of supported types, run ag --list-file-types.So you could also runag --java 'ftp' .though that would restrict the search to file names ending in .java or .properties