#!/bin/bash awk -F ' +|:' '/3306.+ESTABLISHED/{list[$6]++}END{for(i in list){print list[i]" "i}}' "./nowcoder.txt" | sort -k1 -n -r