Calculate Word occurrences from file in bash
I'm sorry for the very noob question, but I'm kind of new to bash programming (started a few days ago). Basically what I want to do is keep one file with all the word occurrences of another file I know I can do this: sort | uniq -c | sort the thing is that after that I want to take a second file, calculate the occurrences again and update the first one. After I take a third file and so on. What I'm doing at the moment works without any problem (I'm using grep , sed and awk ), but it looks pretty slow. I'm pretty sure there is a very efficient way just with a command or so, using uniq , but I