I'm trying to figure out the number of lines that contain the strings "event" and "type". The files I want to search through are in multiple folders and are zipped. I'm able to get an aggregated count of what I'm looking for, but my goal is to have the count displayed for each file. This is what I'm currently using:
zcat /folder1/{folderA,folderB,folderC}/folder2/folder3/result-2018-05-1* | grep 'event' | grep 'type' | wc -l
And my output is:
86446
But I want my output to look like:
result-2018-05-10.log.gz: 1000
result-2018-05-11.log.gz: 3000
result-2018-05-12.log.gz: 20000
result-2018-05-13.log.gz: 4446
result-2018-05-14.log.gz: 12000
result-2018-05-15.log.gz: 10000
result-2018-05-16.log.gz: 15000
result-2018-05-17.log.gz: 5000
result-2018-05-18.log.gz: 6000
result-2018-05-19.log.gz: 10000
Any suggestions?