LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-05-2012, 04:32 AM   #16
dragonix
Member
 
Registered: Nov 2012
Location: Belgium
Distribution: Ubuntu 12.04
Posts: 69
Blog Entries: 6

Original Poster
Rep: Reputation: 1

oke but again, still nothing more and I'm running it now for maybe 2 hours..

EDIT
Fixed it. Final command

Code:
find . -type f -name <specified the file name> -exec grep -l <specified search criteria> {} \;
I used the -name attribute, didn't use that before..

Thanks guys for helping!

Last edited by dragonix; 12-05-2012 at 04:35 AM.
 
Old 12-05-2012, 07:25 AM   #17
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,435

Rep: Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506Reputation: 1506
Quote:
Originally Posted by dragonix View Post
Code:
find . -type f -exec grep -lr --device=skip <criteria> {} \;
With that command line, find will spawn a new instance of grep for every file, making the whole procedure very slow. Also, it is quite pointless (but harmless) to tell grep to recurse when you are giving it only ordinary files to examine, and of course the "--device=skip" option is unnecessary for that same reason. Better:
Code:
find . -type f -exec grep -l  <criteria> {} +
Note the trailing "+" rather than ";" to tell find that the grep command accepts multiple arguments.
 
  


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
recursive grep speed allasso Linux - General 10 06-09-2010 07:22 PM
how does recursive grep work? serutan Linux - Newbie 5 07-11-2008 01:00 PM
Sorting recursive 'ls' and 'grep' SirTristan Linux - Newbie 5 03-13-2008 02:39 PM
recursive grep xpucto Solaris / OpenSolaris 2 05-29-2007 09:57 AM
Recursive grep jimieee Linux - General 5 10-06-2003 10:13 AM


All times are GMT -5. The time now is 04:11 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