To count all the matches from the command line:
grep -oF -f firstfile secondfile | sort | uniq -c [download]
In reply to Re^2: search text file by jwkrahn in thread search text file by Anonymous Monk