netstat -ant | awk 'NR>2{status[$NF]++}END{for(s in status) print s,status[s]}'awk '{num[$1]+=$2}END{for(a in num) print a,num[a]}' 2.txt