Unix/Linux Go Back    


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 !!

Find data within file

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 08-10-2005
gozer13's Unix or Linux Image
gozer13 gozer13 is offline
Registered User
 
Join Date: Dec 2004
Last Activity: 12 August 2005, 10:44 AM EDT
Location: Salt Lake City, Utah
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
Computer Find data within file

Is there a shell command (Solaris v8 ksh) that will allow me to find in the vast directory tree, specific criteria contained in possibly multiple ascii files? Kind of like a find-in kind of thing.
Sponsored Links
    #2  
Old Unix and Linux 08-10-2005
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
 
Join Date: Feb 2004
Last Activity: 26 April 2015, 3:33 PM EDT
Location: NM
Posts: 10,434
Thanks: 328
Thanked 857 Times in 796 Posts

Code:
find /path -name \*.log -exec grep -l "string to find" {} \;

Is the what you mean - look thru loads of files with .log extensions (for example) and get the names of the files with "string to find" in them
Sponsored Links
    #3  
Old Unix and Linux 08-10-2005
gozer13's Unix or Linux Image
gozer13 gozer13 is offline
Registered User
 
Join Date: Dec 2004
Last Activity: 12 August 2005, 10:44 AM EDT
Location: Salt Lake City, Utah
Posts: 46
Thanks: 0
Thanked 0 Times in 0 Posts
I guess I was looking for a specific command, but a grep will work. I guess I can get really creative and make a script with all kinds of cool options. Thanks for the post Jim, I appriciate it.
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Find line number of bad data in large file pchang Shell Programming and Scripting 3 01-14-2011 12:02 PM
Find and replace data in text file with data in same file timothyha22 Shell Programming and Scripting 0 12-09-2009 03:28 PM
C Shell problem: using a key from one file to find data in another bassmaster Shell Programming and Scripting 2 12-03-2009 03:28 PM
to find header in Mp3 file and retrieve data shashi Programming 2 09-12-2008 03:03 AM
find the position in a file and insert the data there isingh786 HP-UX 5 04-11-2006 09:31 PM



All times are GMT -4. The time now is 04:58 PM.