LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   bash find grep couple alternative (https://www.linuxquestions.org/questions/linux-newbie-8/bash-find-grep-couple-alternative-4175502710/)

marcos egatz 04-23-2014 10:29 AM

bash find grep couple alternative
 
Hello,
Since some time ago I've found myself using prolifically the common combination of commands find-grep to find files matching a certain regex pattern. And I wander if there is faster alternative to this archetype. Maybe there's a tool that could build on some sort of index that allows to improve performance over successive searches.

marcos egatz 04-23-2014 10:51 AM

After a while I've found that command "locate" seemed to do what I needed.

catkin 04-23-2014 11:41 AM

Are you using grep on the file names or the files' contents?

marcos egatz 04-24-2014 09:44 AM

Catkin thanks for replying. By the way I use the find in the following manner,
find . -type f -name "*.txt" -exec grep "regex" {} \;


All times are GMT -5. The time now is 01:54 PM.