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 The 10 and 8 bash 7 command 6 help....
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?