This question is an additional constraint on this this question. I wanted achieve the word count by avoiding multiple counts for that same word in the same file? Eg : if word "aaa" appears in "file1.txt" 10 times, but count should increase only by 1 but not 10 & so on for other files too within a directory.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
So what you want is the number of files that contain that word. Easy:
grep -l word *|wc -l