I have a bunch of log files. I need to find out how many times a string occurs in all files.
grep -c string *
returns
... f
Another oneliner using basic command line functions handling multiple occurences per line.
cat * |sed s/string/\\\nstring\ /g |grep string |wc -l