The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 06-30-2009
pranabrana's Avatar
pranabrana pranabrana is offline
Registered User
  
 

Join Date: Jun 2008
Location: Bangalore
Posts: 19
counting the occurence of a word

In a file I have to count a particular word. like i need apache how many times.

I tried this

$ tr "\011" "\012\012"<foo1 | tr -cd "[a-zA-z\012]" |sort\uniq -c


but I got result like this

32 apache
18 dns
12 doctor


Please sugest me