按小时统计tomcat访问量awk命令: awk -F":" '{count[$2]++} END{for(i=0; i<24; i++){if(i<10){bb=0""i;}else{bb=i;} print bb"\t"count[bb]}}' 示例: