# this awk program gives frequency of occurance of all names in a field. BEGIN {sep=" "} { lslsh=7; while($lslsh!="/")lslsh++; rslsh=lslsh+2; while($rslsh!="/")rslsh++; if($7!="WHOIS") for(j=lslsh+1;j<=rslsh-1;j++)++sum[$j] else { concat=$7; for(j=lslsh+1;j<=rslsh-1;j++)concat=concat sep $j; ++sum[concat] } } END {for (name in sum) print sum[name], name | "sort -bdfrin"} .