【 以下文字转载自 Linux 讨论区 】
【 原文由 ayanami 所发表 】
How do I use shell command only to determine the most frequently appeared
word in a text file?
j*****h 发帖数: 62
2
I guess you can do it in the following steps, using shell pipes to connect them.
1. use "sed" to convert the text into a stream of words separated by newline
2. use "sort" to sort the words
3. use "uniq" to count the number of unique words.
【在 a*****i 的大作中提到】 : 【 以下文字转载自 Linux 讨论区 】 : 【 原文由 ayanami 所发表 】 : How do I use shell command only to determine the most frequently appeared : word in a text file?