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
word count wc chaandana UNIX for Dummies Questions & Answers 5 05-05-2009 11:47 AM
trying to create a script to read a flie and loop a command... Italy87 UNIX Desktop for Dummies Questions & Answers 5 03-26-2008 08: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 09:44 AM
specified word count bhaviknp Shell Programming and Scripting 5 02-27-2008 11:23 AM
count word ariuscy UNIX for Dummies Questions & Answers 1 10-13-2005 01:36 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-22-2008
sipmohan sipmohan is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
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
  #2 (permalink)  
Old 02-22-2008
kanu_kanu kanu_kanu is offline
Registered User
  
 

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

Last edited by kanu_kanu; 02-22-2008 at 02:36 AM..
  #3 (permalink)  
Old 02-22-2008
sipmohan sipmohan is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 2
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.
  #4 (permalink)  
Old 02-22-2008
Yogesh Sawant's Avatar
Yogesh Sawant Yogesh Sawant is offline Forum Staff  
Part Time Moderator and Full Time Dad
  
 

Join Date: Sep 2006
Location: Rossem, Tazenda
Posts: 1,086
this might be helpful to you
Closed Thread

Bookmarks

Tags
find, grep

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:08 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