grep outputs any lines that match a pattern. I want to be able to find lines that match the pattern multiple times. For example, if my search pattern was "foo", then:
foo bar # Would not be matched foo foo bar # Would be matched bar foofoo # Would be matched foobarfoo # Would be matched
Is there a way I can tell
grep to find only lines that contain multiple matches of my search pattern?