Question for a Unix Command Line Tool Expert
Unix command line tools have never been a strong area for me. Who can suggest a solution to the following problem?
I have many text files in a folder. I would like to list a count of how many lines a certain regular expression matches within each file. The output would be something like this:
file1.txt: 23
file2.txt 0
file3.txt 37
I’m sure there must be a way using grep, sort, wc, and so on, without resorting to a for loop in a script file. However I haven’t found it yet.