Hye guys
I have two problems in unix.
1. The first problem is that I wanna search for a word in a text file and then print it's count i.e how many times it occurs in that file.Now I tried this
grep "searchword" filename | wc -l
it works well but it counts the lines where the search word appears.If the word appears twice in a line,it still counts it as one.So pls help.I want the word count,not the number of lines matching the pattern.
2.Second problem is that I need to count number of symbols (* % $ etc) in a file.How can I do that??
Thanks in advance.
2006-10-26
20:41:21
·
2 answers
·
asked by
helpingspirits1
2
in
Computers & Internet
➔ Programming & Design