That's.... a really poor comparison, maybe you missed some background on what exactly the interviewer was looking for. Sure, maybe CLI knowledge is going to be useful, but if you're looking for experience with Java because you're going to implement some complex string filtering in it, then the 2nd candidate's solution is literally useless as a comparison point. Also, if you're comparing them directly you're essentially punishing the 1st developer for maybe not having experience with some technology that was particularly well suited for that question.
Would you also have accepted a solution like "I send the file to someone on Mechanical Turk to find the words"? Or "I ask my daughter to look through them and find them"? Or "I ask someone in an interview to write a program to find it out"? Or "I paste it into this online tool that produces statistics of the most common words in some text"?
Would you also have accepted a solution like "I send the file to someone on Mechanical Turk to find the words"? Or "I ask my daughter to look through them and find them"? Or "I ask someone in an interview to write a program to find it out"? Or "I paste it into this online tool that produces statistics of the most common words in some text"?