#!/bin/bash awk -F ':' '{arr[$2":"$3]++}END{ # 这边的:需要用""包围,其他思路和前面的题目相同 for (i in arr){ printf "%d %s \n",arr[i],i } }'|sort -k 1 -r