Alex Rivera | Logout

Ack: Search directory tree for files with a particular extension

Asked 2011-11-19T20:28:33.720
16

I basically just want to do ack foo *.citrus and have ack drill down and find the string 'foo' in all Citrus files in the current directory and below. The trouble is that this won't work if there aren't any Citrus files in the current directory.

I tried messing with -G without success. Do I really need to add a file type in .ackrc just to limit the search to files with a given extension?

ack
Edit
Report

1 Answer

4

You don't have to set it in .ackrc if you don't want. You can also set ACK_OPTIONS in your environment, or specify --type-set arguments on the command line. ack doesn't care.

answered 2012-02-26T05:15:05.557

Your Answer