The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM
Home Forums Register Rules & FAQ Members List Arcade Search Today's Posts Mark Forums Read


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


Other UNIX.COM Threads You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What is the Best way to search files for a string?? 35Soinc UNIX for Dummies Questions & Answers 15 03-25-2008 12:34 PM
Search files that all contain 4 specific words WoodenSword Shell Programming and Scripting 13 01-22-2007 02:57 AM
How to search files containing a specific word in the content amjath78 UNIX for Dummies Questions & Answers 1 01-03-2007 11:42 AM
Print lines with search string at specific position HealthyGuy Shell Programming and Scripting 4 12-04-2006 05:47 AM
Search for Files that DONT contain a string tonydsam UNIX for Dummies Questions & Answers 11 05-02-2006 12:05 PM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-05-2002
Registered User
 

Join Date: Sep 2001
Location: UK
Posts: 25
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Search all files for specific string

Hi Friends,

How can I search all files in all slices on a unix system for a particular string within the file.

e.g search string 'oracle'

Thanks
Forum Sponsor
  #2 (permalink)  
Old 02-05-2002
mib mib is offline
Registered User
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
grep -rn oracle /dir/


(GNU grep) 2.4.2

Last edited by mib : 02-05-2002 at 06:29 AM.
  #3 (permalink)  
Old 02-06-2002
Registered User
 

Join Date: Sep 2001
Location: UK
Posts: 25
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Hi,

Thanks for your reply.

I'm afraid that command doesn't work with my version of unix :

SCO Unixware 7

I believe I need to do a find and pipe to grep but don't know the exact syntax, can you help ?

Thanks

Suresh
  #4 (permalink)  
Old 02-06-2002
LivinFree's Avatar
Goober Extraordinaire
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
If you want to search the *entire* system for files containing oracle, try this:
Code:
find / -type f -exec grep -l "oracle" {} \; 2>/dev/null 1>/tmp/my_search &
That will run in the background. It's best to do this as root, and even better to do it from maintenance mode (no users on, since it'll slow everyone down), and you may also have to stop jobs like "cron"... I had a problem once doing a similar search, and grep got stuck in a FIFO created by cron...
  #5 (permalink)  
Old 03-06-2002
Registered User
 

Join Date: Sep 2001
Location: UK
Posts: 25
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiReddit! Stumble this Post!Spurl this Post!
Thanks for your help folks
Google UNIX.COM
Closed Thread



Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 05:47 PM.


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

Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102