counting a list of string in a list of txt files
Hi there!
I have 150 txt files named chunk1, chunk2, ........., chunk150. I have a second file called string.txt with more than 1000 unique strings, house, dog, cat ... I want to know which command I should use to count how many times each string appears in the 150 files.
I have tried with a grep -c dog chunk* but then I get the count of all of the files and I have to do it separately for each of the strings.
The ideal solution would be an output saying:
dog 45
cat 69
house 92
song 45
Thanks a lot in advance.
Kind regards,
Pep
|