The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
grep, find or awk? netrom UNIX for Dummies Questions & Answers 4 04-09-2008 05:03 PM
grep and find MEllis5 UNIX for Dummies Questions & Answers 1 04-07-2008 08:16 AM
find then grep flame_eagle Shell Programming and Scripting 7 03-13-2008 11:19 AM
find and grep sarwan High Level Programming 4 04-10-2006 07:05 AM
find & grep Anika UNIX for Dummies Questions & Answers 11 02-01-2001 12:19 PM

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

Join Date: Jan 2008
Posts: 11
find , grep

HI
what is the difference between find and grep

if I want to find all the files from different directories which contain "ORA" error, and the line number in each file which has ORA error
should I use pipeline ?
thanks

James
  #2 (permalink)  
Old 02-01-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Join Date: Dec 2007
Location: Home of 17-time world champion Boston Celtics
Posts: 1,311
finding text in files

>grep -i word *

will show the filename and line of text for all instances where word is found

on differences:
grep looks at what is in files
find locates files, as in by name
  #3 (permalink)  
Old 02-01-2008
bobbygsk bobbygsk is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 90
To find the string in all the files
Quote:
grep <string> *
To find the string in the files in all the sub directories
Quote:
find . -type f -print | grep <string>
  #4 (permalink)  
Old 10-09-2008
gunaah gunaah is offline
Registered User
  
 

Join Date: Sep 2008
Posts: 7
grep - you can do wider search with diff options using the pattern string in the file
find - able to locate the file that has the pattern string
Sponsored Links
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 09:25 PM.


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