Wednesday, December 16, 2015

ack options to list only file names

-w - Search whole word
-l  - Only print the filenames of matching files
-r - Recurse into subdirectories

ack -lrw '< MySuperClassName' --ignore-dir={app/assets,log,spec,vendor,public,coverage,config}

You can chain this to xargs to open all the matching file for editing like this:

ack -lrw '< MySuperClassName' --ignore-dir={app/assets,log,spec,vendor,public,coverage,config} | xargs mate