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
Search for Files that DONT contain a string tonydsam UNIX for Dummies Questions & Answers 13 05-27-2009 02:19 AM
What is the Best way to search files for a string?? 35Soinc UNIX for Dummies Questions & Answers 15 03-25-2008 04:34 PM
Search files that all contain 4 specific words WoodenSword Shell Programming and Scripting 13 01-22-2007 06:57 AM
How to search files containing a specific word in the content amjath78 UNIX for Dummies Questions & Answers 1 01-03-2007 03:42 PM
Print lines with search string at specific position HealthyGuy Shell Programming and Scripting 4 12-04-2006 09:47 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-05-2002
sureshy sureshy is offline
Registered User
  
 

Join Date: Sep 2001
Location: UK
Posts: 25
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
  #2 (permalink)  
Old 02-05-2002
mib mib is offline
Registered User
  
 

Join Date: Jan 2001
Location: Calicut
Posts: 228
grep -rn oracle /dir/


(GNU grep) 2.4.2

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

Join Date: Sep 2001
Location: UK
Posts: 25
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
LivinFree LivinFree is offline Forum Advisor  
Goober Extraordinaire
  
 

Join Date: Jul 2001
Location: Portland, OR, USA
Posts: 1,584
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
sureshy sureshy is offline
Registered User
  
 

Join Date: Sep 2001
Location: UK
Posts: 25
Thanks for your help folks
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 02:57 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0