mh, good question I assume it did not work for a specific situation, then I got used to do it by find (I vaguely remeber that this snippet was part of a bigger solution once).
By looking at my code, I realized another embarassing mistake - it is grep -n of course, not grep -c .
Edit:
I tried a little and I think what I did not like about grep -R is that it also give the matching line (with -o only the match). I just simply want a list of occurences with path and line number.
Therefore my new solution is this: