法一:
netstat -n | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}‘
法二:
netstat -an | awk ‘/^tcp/{print $6}‘ | sort | uniq -c | sort -nr
查看EST状态的连接数:
[[email protected] lib]# netstat -an | grep "EST" | wc -l
例:
http://oldboy.blog.51cto.com/blog/2561410/1184177
和TCP有关的命令:
tcpdump
netstat
ss
Tcpdive http://blog.csdn.net/zhangskd/article/details/50529254
netstat -tlun | grep 80
ps -ef | grep apache
lsof –i:80
时间: 2024-11-05 11:29:31