Say I have 1000 files in multiple recursive folders and say the string 'testing' is in 600 files and total number of mention of 'testing' within those 600 files is 750 times. Then -
I need something like "750 matches across 600 files
"
I got close as -
grep -Rcl 'string' .
Which gives me name of every file but I just want the numbers.
and
grep -roh 'string' . | wc -w
Which gives me just the number of occurrences
Can you please let me have the whole command?
Thank you
grep -roh 'string' . | wc -w
and how can I get the number of files, not the file names just the number. Thank you. @Community