I have a list of files, 10 to be exact, in a recipe folder. I must determine the number of occurences of each word in all the files and then order them according to these frequencies. I can get my command to work on one file at a time, but I need it to work on each file at once and then output to one single file. For example: The word salt appears a total of 25 times overall, then output would be: 25 salt. So far I have this:
sed -d 's/\s/\n/g' < lyrics01.txt | sort | uniq -c | sort -nr >> lyrics01wordcount.tf
I need this to be altered to work on every file in the directory, I understand why it is working on one above. Any help would be much appreciated.