Counting Things in Awk: Associative Arrays as Your First Aggregation Tool
Awk's associative arrays turn frequency counting and log aggregation into a one-liner. Here's the count[key]++ pattern, a worked example, and the memory and ordering limits to watch.