I have a bunch of log files. I need to find out how many times a string occurs in all files.
grep -c string *
returns
... f
Something different than all the previous answers:
perl -lne '$count++ for m//g;END{print $count}' *