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
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 4 Weeks Ago 09:37 AM
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 05:12 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 03:47 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 03:38 PM
how to find a file in UNIX without find command? bluo Shell Programming and Scripting 3 09-24-2003 08:47 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 10-26-2005
Registered User
 

Join Date: Aug 2005
Posts: 5
find command

I need help with the find command. I want to find all files that contain 'SCHD'.
Can anyone help me?
Reply With Quote
Forum Sponsor
  #2  
Old 10-26-2005
Registered User
 

Join Date: Aug 2005
Posts: 28
try this comand

find / -name "SCHD*" -type f -print
Reply With Quote
  #3  
Old 10-26-2005
Registered User
 

Join Date: Aug 2005
Posts: 5
SCHD will not be in the name of the file. It will be in the contents. Is there any way to do this?
Reply With Quote
  #4  
Old 10-26-2005
vertigo23's Avatar
Registered User
 

Join Date: Jul 2005
Location: SF, CA
Posts: 67
find / -type f | xargs grep -l SCHD
Reply With Quote
  #5  
Old 10-26-2005
vino's Avatar
Supporter (in vino veritas)
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,683
Quote:
Originally Posted by vertigo23
find / -type f | xargs grep -l SCHD
If you run into the problem of "Too many arguments", try this

find / -name '*.*' - exec grep 'SCHD' {} \; -print
Reply With Quote
  #6  
Old 10-26-2005
vertigo23's Avatar
Registered User
 

Join Date: Jul 2005
Location: SF, CA
Posts: 67
Or, if that's too slow or you run into "No such file or directory" errors, try this:
Code:
find / -type f | while read file; do
  grep -l SCHD "$file"
done
Reply With Quote
  #7  
Old 10-26-2005
Registered User
 

Join Date: Aug 2005
Posts: 5
Thanks!

Thanks for all your help! I got the information that needed.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 10:13 AM.


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

Content Relevant URLs by vBSEO 3.2.0