Count all occurrences of a string in lots of files with grep
This works for multiple occurrences per line:
grep -o string * | wc -l
cat * | grep -c string
grep -oh string * | wc -w
will count multiple occurrences in a line
This works for multiple occurrences per line:
grep -o string * | wc -l
cat * | grep -c string
grep -oh string * | wc -w
will count multiple occurrences in a line