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 two words in sed ajitkumar2 Shell Programming and Scripting 12 08-01-2008 12:00 AM
grep on multiple words to match text template rider29 Shell Programming and Scripting 6 05-23-2008 08:21 AM
problem with grep on search string in a txt file over multiple files m00 UNIX for Dummies Questions & Answers 2 05-18-2008 11:21 AM
grep with find to search for matchiing words akhil313 UNIX for Dummies Questions & Answers 1 12-12-2006 07:18 AM
multiple search with grep amon Shell Programming and Scripting 5 04-04-2006 03:53 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #15  
Old 08-22-2008
Registered User
 

Join Date: Aug 2008
Posts: 18
!0 u , its working........

could you please tell me how it will work.....
Reply With Quote
Forum Sponsor
  #16  
Old 08-22-2008
vidyadhar85's Avatar
The Tutor
 

Join Date: Jun 2008
Location: INDIA
Posts: 547
Quote:
Originally Posted by vidyadhar85 View Post
try this....
simple.. first i am taking files which have word1 then i am passing those file names as argument to next grep which search for word2...
you can do it by awk also...
Reply With Quote
  #17  
Old 08-22-2008
Registered User
 

Join Date: Aug 2008
Posts: 18
suppose if i want search more than two can i use like

grep -l "word1" *.log|xargs grep -l "word2" |xargs grep -l "wrod3"
Reply With Quote
  #18  
Old 08-22-2008
vidyadhar85's Avatar
The Tutor
 

Join Date: Jun 2008
Location: INDIA
Posts: 547
Quote:
Originally Posted by pb18798 View Post
suppose if i want search more than two can i use like

grep -l "word1" *.log|xargs grep -l "word2" |xargs grep -l "wrod3"
ya sure it works like word1 and word2 and word3..
Reply With Quote
  #19  
Old 08-22-2008
Registered User
 

Join Date: Aug 2008
Posts: 18
10 u very much.........
Reply With Quote
  #20  
Old 08-25-2008
Registered User
 

Join Date: Feb 2008
Posts: 1
How about
grep word1 *.log | grep word2
Reply With Quote
  #21  
Old 08-25-2008
Registered User
 

Join Date: Aug 2008
Location: coimbatore
Posts: 1
Angry I need help in searching a word from a file

Hi Guyz,,

I have a file error.log

it has contents..

ldap_add: Already exists
ldap_add: Already exists


All i need is.. i have to extract the word Already exists alone into a variable..

i tried using grep it s printing the whole line....

can any one help me plz...

tHANKS AND REGARDS.

Cruiser Bob

Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:03 PM.


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