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
Count number of occurences of a word shikhakaul UNIX for Dummies Questions & Answers 8 06-25-2009 12:10 PM
count occurences of specific character in the file superprogrammer HP-UX 9 04-09-2008 12:05 PM
Help with scritp to count an specific word into a log lestat_ecuador Shell Programming and Scripting 5 09-07-2007 01:00 PM
grep and count no of occurences in every line of a file srikanthgr1 Shell Programming and Scripting 12 04-20-2007 10:16 AM
Counting occurences of specific charachter in a file GMMike UNIX for Dummies Questions & Answers 3 10-13-2004 03:46 PM

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 10-30-2008
mskart mskart is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 6
Smile How to count the occurences of a specific word in a file in bash shell

Hello,

I want to count the occurences of a specific word in a .txt file in bash shell.

Can somebody help me pleaze??

Thanks!!!
  #2 (permalink)  
Old 10-30-2008
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,794

Code:
tr -s ' ' '\n' < myfile.txt | grep -c 'searchword'

  #3 (permalink)  
Old 10-30-2008
mskart mskart is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 6
Thanks a lot it really works!
Closed Thread

Bookmarks

Tags
count, count words, words

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 06:44 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