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
trying to create a script to read a flie and loop a command... Italy87 UNIX Desktop for Dummies Questions & Answers 5 03-26-2008 04:36 AM
trying to create a script to read a flie and loop a command... Italy87 UNIX for Advanced & Expert Users 1 03-25-2008 05:44 AM
specified word count bhaviknp Shell Programming and Scripting 5 02-27-2008 07:23 AM
count word ariuscy UNIX for Dummies Questions & Answers 1 10-12-2005 09:36 PM
word count wc chaandana UNIX for Dummies Questions & Answers 4 07-24-2005 10:15 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-21-2008
Registered User
 

Join Date: Feb 2008
Posts: 2
Stumble this Post!
Question script to count a word in a flie

hi All,

I have one question to have a answer with your help.

i need to have a script for searching a file with .log extension form all directories. search for a word " Pass" in the files and to count the occurence of the word "Pass".

i need all your help to solve the problem.

Thanks,
mohan
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-21-2008
Registered User
 

Join Date: Feb 2008
Posts: 15
Stumble this Post!
find / -name "*.log" -exec grep -c "Pass" {} \;

Last edited by kanu_kanu; 02-21-2008 at 10:36 PM.
Reply With Quote
  #3 (permalink)  
Old 02-21-2008
Registered User
 

Join Date: Feb 2008
Posts: 2
Stumble this Post!
Quote:
Originally Posted by kanu_kanu View Post
grep -c "Pass" <file_name> will do
hi Kanu,

Thanks for your input.

as i am a new to scripting i request you to help me with full script. I do not know much about the scripting.

Thanks.
Reply With Quote
  #4 (permalink)  
Old 02-21-2008
Yogesh Sawant's Avatar
Part Time Moderator and Full Time Dad
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 767
Stumble this Post!
this might be helpful to you
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
find, grep

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:57 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 Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0