LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-23-2014, 11:29 AM   #1
marcos egatz
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Rep: Reputation: 0
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.
 
Old 04-23-2014, 11:51 AM   #2
marcos egatz
LQ Newbie
 
Registered: Nov 2008
Posts: 8

Original Poster
Rep: Reputation: 0
After a while I've found that command "locate" seemed to do what I needed.
 
Old 04-23-2014, 12:41 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Are you using grep on the file names or the files' contents?
 
Old 04-24-2014, 10:44 AM   #4
marcos egatz
LQ Newbie
 
Registered: Nov 2008
Posts: 8

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] how to use cp find and grep together to copy a list of files using find with grep babhijit Linux - Newbie 10 07-03-2013 01:25 PM
[SOLVED] BASH (grep / sed / awk): find string within a (line) range dragonetti Linux - Newbie 2 11-24-2011 11:16 PM
[SOLVED] [bash] find | grep optimization hashbang#! Programming 13 11-20-2010 12:41 PM
bash script: find, grep if and else programing.. snaaps Linux - Newbie 3 10-20-2010 09:24 PM
Bash scripting question with find and grep and .bashrc - a multi year problem brfindla Linux - Software 9 08-24-2009 10:54 AM


All times are GMT -5. The time now is 03:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration