Count all occurrences of a string in lots of files with grep November 6, 2022 by Tarik This works for multiple occurrences per line: grep -o string * | wc -l