0

i have a multiple files in a folder. i want to read the files to count a word present and print with filename.

for example: numeric value is matching count of the string

filename string1 string2
file1      5       1
file2      3        7
ghoti
  • 45,319
  • 8
  • 65
  • 104
  • Any particular {set of} words, or do you just want a word count of all words in all files? Also, please let us know [what you have tried](http://whathaveyoutried.com/). Most of us here are happy to help you improve your craft, but are less happy acting as short order unpaid programming staff. Show us your work so far in an [MCVE](http://stackoverflow.com/help/mcve), the result you were expecting and the results you got, and we'll help you figure it out. – ghoti Jul 28 '17 at 10:24

1 Answers1

0

find . -name "ABC" -exec grep -H 'XYZ' {} +

reference link

Tushar Walzade
  • 3,737
  • 4
  • 33
  • 56