标签: recursion count grep unique
我想要浏览多个文件并显示结果的唯一性和计数。例如:
filea: text1 text2 text3 fileb: text1 text3 filec: text2 text3 grep -r "text*" ??? output: text1 2 text2 2 text3 3
答案 0 :(得分:0)
试试这个:
awk '/text/{a[$0]++}END{for(x in a)print x,a[x]}' file*
我没有测试过,但应该去测试。