I have started using ack which is much faster than grep. However using ack I want to search for file name rather than file contents. Is there a way to do that?
|
feedback
|
migrated from stackoverflow.com Apr 25 '10 at 14:24
This question came from our site for professional and enthusiast programmers.
|
Use the right tool for the right job. If you want to search for filename, use 'find':
| |||||||
feedback
|
Print files where the relative path + filename matches REGEX | |||
|
feedback
|
|
I agree it makes sense to use find if you're just searching for *.txt files. However, ack has powerful file-type detectiong features, so you can use
which will find all the Perl files, based on both the filename (*.pm, *.pl, *.t and *.pod) and the shebang line. | |||
|
feedback
|