The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Recursive grep upstate_boy UNIX for Dummies Questions & Answers 16 05-18-2008 02:16 PM
word wrap issue with grep bowtiextreme HP-UX 4 04-30-2008 04:39 PM
issue with grep soujanya_srk UNIX for Dummies Questions & Answers 3 01-04-2008 02:38 PM
recursive GREP ? alan UNIX for Dummies Questions & Answers 3 08-22-2003 12:15 AM
grep recursive directories jagannatha UNIX for Dummies Questions & Answers 8 07-24-2003 01:00 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 08-09-2006
Registered User
 

Join Date: Nov 2003
Posts: 10
recursive grep issue

I've searched the forum on how to do recursive grep and have found the probable solution. My problem is it doesn't print the results! I used this command grep -li lam * and it finds the correct file in that directory. When I use the find command to do this recursively I can hear the harddrive working but no results are printed to the screen. The command I used was this: find / -type f -exec grep -li lam {}\; I was hoping this would search the entire root directory for the word lam and print the filenames out for me. I believe it does the search but nothing is printed. Any thoughts?
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 08-11-2006
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
If you want to print filenames aswell, you need to specify at least two filenames to each pass of grep, so something such as the following will do the trick...

find / -type f -exec grep -li "lam" {} /dev/null \;

Although... it should print the filenames without the /dev/null as -l is used. Are you sure there are files containing the searchstring that you are specifying, and you have permission to read them?

Cheers
ZB
Reply With Quote
Google UNIX.COM
Reply

Tags
grep, grep recursive, recursive grep

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:07 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0