# cat word.txt hello hadoop hello spark hello yarn hello hdfs hello hive hello hbase hello storm bye hadoop
要达到如下效果:
参考答案:
cat words.txt | tr -s ' ' '\n' | sort | uniq -c | sort -r | awk '{ print $2, $1 }'
以上。