Using awk you can search for the occurrence of a string, show the number of times it was found and the linenumber on which it was found. Here I wanted to see only those lines that have the search string more than once.
As input I'm using man page for ls. I put the search string (here: 'of') in a variable.
s='of'; man ls | awk -v s="${s}" '{ if ($0 ~ s) { k = split($0, ar, s); if (k > 2) { print NR, k-1, $0 }}}' | grep "${s}"
Output:
32 2 -c with -lt: sort by, and show, ctime (time of last modification of file status information); with -l: show ctime and sort by name; otherwise: sort by ctime, newest first
180 2 The SIZE argument is an integer and optional unit (example: 10K is 10*1024). Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000). Binary prefixes can be used, too: KiB=K,
The grep statement is used to colorize the search string (not visible here).