LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 12-05-2012, 04:32 AM   #16
dragonix
Member
 
Registered: Nov 2012
Location: Belgium
Distribution: Ubuntu 12.04
Posts: 69

Original Poster
Blog Entries: 6

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: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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



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

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

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