netstat -nta| grep 8080 |wc -l wc -l 统计一共有多少行 参考文档: http://www.cnblogs.com/peida/archive/2012/12/18/2822758.html