I'm doing ag "active_record" ., but I want to only care about .rb files.
How do I limit what file types it searches on the command line?
I'm doing ag "active_record" ., but I want to only care about .rb files.
How do I limit what file types it searches on the command line?
Succintly,
ag active_record --ruby
Also you can use:
ag --list-file-types to list the supported file types
Otherwise you can limit by extension (also for unknown filetypes) by providing a regex as follows:
ag -G'\.rb$' active_record
Edited due to correction by bobbaluba
ag active_record --ruby. – vise Oct 11 '17 at 10:34-G, not-g. – bobbaluba Feb 15 '18 at 15:29