#!/bin/awk { if($1 in tab){ tab[$1] ++; }else{ tab[$1] = 1; } } END{ for(i in tab) print i, tab[i]; }