LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 10: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, 10: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, 11:41 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Are you using grep on the file names or the files' contents?
 
Old 04-24-2014, 09: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



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 12:25 PM
[SOLVED] BASH (grep / sed / awk): find string within a (line) range dragonetti Linux - Newbie 2 11-24-2011 10:16 PM
[SOLVED] [bash] find | grep optimization hashbang#! Programming 13 11-20-2010 11:41 AM
bash script: find, grep if and else programing.. snaaps Linux - Newbie 3 10-20-2010 08:24 PM
Bash scripting question with find and grep and .bashrc - a multi year problem brfindla Linux - Software 9 08-24-2009 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:33 AM.

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
Open Source Consulting | Domain Registration