netstat -tunlp
netstat -nat | grep “10.150.185.178:80″ | awk ‘{print $5}’ | awk -F: ‘{print $1}’ | sort | uniq -c | sort -nr | head -20
netstat -nat | awk ‘{print $6}’ | sort | uniq -c | sort -rn
或 netstat -na | awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’ 另外分析access.log获得访问前10位的ip地址可以用如下命令:
awk ‘{print $1}’ access.log | sort | uniq -c | sort -nr | head -10
(责任编辑:IT) |