I can't figure this out. I just want a total count of a
string in a file. Using the grep -c option just gives me
the line count, but misses is I have multiple matches on a
line.
The following is a start. It will not find partial word matches like 'textual' only 'text' as a distinct word. This script could also be squashed down into a one-liner or better yet a script that takes an argument.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.