I have already asked a similar question but people misunderstood what i was asking. I was asking how to generate a list of every word with a word count incremented only once per word per file.For example, I have a directory with 10 files , I want to generate a list of words using bash commands which says a value of 1-10 depending on how many files they appear in:10 The10 and8 bash7 command6 help....etc.I already know that grep -l word *| wc -l will search for a single word but I want to create a list of all words.Is there a way to combine that with tr '[A-Z]' '[a-z]' | tr -d '[:punct:]' so that words with capital letters aren't duplicated and punctuation is removed?
How to count occurrences of all the words in all the files of a directory using grep? But with count incremented only once per word per file
bash;files;grep;directory