我用如下命令netstat -na|awk ' $4="本服务器ip:80,$6=ESTABLISHED" {print $5}' >文件(文件为要导入的文件)好像不行
请大家帮忙
8 个解决方案
#1
netstat -na|grep 80 |grep ip | grep ESTABLISHED |awk '{print $5}' >文件
#2
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -na | uniq | wc -l
就是不同的IP数
就是不同的IP数
#3
哦,错了,应该是
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq | wc -l 或者
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort | uniq | wc -l
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq | wc -l 或者
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort | uniq | wc -l
#4
如果想看每个IP出现的次数,可以
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
#5
如果想看每个IP出现的次数,可以
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
你这句有点问题
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
你这句有点问题
#6
这是显示的结果
1 61.149.168.74:1058
1 61.180.39.7:62793
1 61.234.134.87:30656
1 202.196.16.225:2968
1 210.21.72.10:2916
1 210.75.250.247:58746
1 210.82.106.25:50464
1 211.136.20.37:45083
1 211.136.20.37:62793
1 211.143.29.2:30349
1 211.94.239.124:3446
1 211.97.241.80:19908
1 218.107.147.121:4354
1 218.12.32.70:6963
1 218.14.27.82:1377
1 218.14.27.82:1387
1 218.14.27.82:1388
1 218.14.27.82:1389
1 218.14.27.82:1390
1 218.14.27.82:1391
1 218.14.27.82:1392
1 218.19.11.222:2651
1 218.19.197.36:41785
1 218.204.81.34:37174
1 218.21.128.42:13640
1 218.242.1.189:4206
1 218.242.1.189:4207
1 218.26.191.66:4761
1 218.26.243.18:2158
1 218.59.153.112:1094
1 218.59.59.56:1216
1 218.61.43.231:1700
1 218.64.248.82:51831
1 218.74.137.176:1245
1 218.90.109.30:3564
1 218.90.109.30:3565
1 61.149.168.74:1058
1 61.180.39.7:62793
1 61.234.134.87:30656
1 202.196.16.225:2968
1 210.21.72.10:2916
1 210.75.250.247:58746
1 210.82.106.25:50464
1 211.136.20.37:45083
1 211.136.20.37:62793
1 211.143.29.2:30349
1 211.94.239.124:3446
1 211.97.241.80:19908
1 218.107.147.121:4354
1 218.12.32.70:6963
1 218.14.27.82:1377
1 218.14.27.82:1387
1 218.14.27.82:1388
1 218.14.27.82:1389
1 218.14.27.82:1390
1 218.14.27.82:1391
1 218.14.27.82:1392
1 218.19.11.222:2651
1 218.19.197.36:41785
1 218.204.81.34:37174
1 218.21.128.42:13640
1 218.242.1.189:4206
1 218.242.1.189:4207
1 218.26.191.66:4761
1 218.26.243.18:2158
1 218.59.153.112:1094
1 218.59.59.56:1216
1 218.61.43.231:1700
1 218.64.248.82:51831
1 218.74.137.176:1245
1 218.90.109.30:3564
1 218.90.109.30:3565
#7
CoolQ() 你是干什么工作的?可以留下QQ吗?
#8
哦,我明白错在哪里了,你需要把218.90.109.30:3565再分成两部分,再进行统计。
工作不敢当,我现在还是学生。
工作不敢当,我现在还是学生。
#1
netstat -na|grep 80 |grep ip | grep ESTABLISHED |awk '{print $5}' >文件
#2
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -na | uniq | wc -l
就是不同的IP数
就是不同的IP数
#3
哦,错了,应该是
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq | wc -l 或者
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort | uniq | wc -l
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq | wc -l 或者
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort | uniq | wc -l
#4
如果想看每个IP出现的次数,可以
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
#5
如果想看每个IP出现的次数,可以
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
你这句有点问题
netstat -na | grep ":80" | grep ESTABLISHED | awk '{print $5}' | sort -n | uniq -c
你这句有点问题
#6
这是显示的结果
1 61.149.168.74:1058
1 61.180.39.7:62793
1 61.234.134.87:30656
1 202.196.16.225:2968
1 210.21.72.10:2916
1 210.75.250.247:58746
1 210.82.106.25:50464
1 211.136.20.37:45083
1 211.136.20.37:62793
1 211.143.29.2:30349
1 211.94.239.124:3446
1 211.97.241.80:19908
1 218.107.147.121:4354
1 218.12.32.70:6963
1 218.14.27.82:1377
1 218.14.27.82:1387
1 218.14.27.82:1388
1 218.14.27.82:1389
1 218.14.27.82:1390
1 218.14.27.82:1391
1 218.14.27.82:1392
1 218.19.11.222:2651
1 218.19.197.36:41785
1 218.204.81.34:37174
1 218.21.128.42:13640
1 218.242.1.189:4206
1 218.242.1.189:4207
1 218.26.191.66:4761
1 218.26.243.18:2158
1 218.59.153.112:1094
1 218.59.59.56:1216
1 218.61.43.231:1700
1 218.64.248.82:51831
1 218.74.137.176:1245
1 218.90.109.30:3564
1 218.90.109.30:3565
1 61.149.168.74:1058
1 61.180.39.7:62793
1 61.234.134.87:30656
1 202.196.16.225:2968
1 210.21.72.10:2916
1 210.75.250.247:58746
1 210.82.106.25:50464
1 211.136.20.37:45083
1 211.136.20.37:62793
1 211.143.29.2:30349
1 211.94.239.124:3446
1 211.97.241.80:19908
1 218.107.147.121:4354
1 218.12.32.70:6963
1 218.14.27.82:1377
1 218.14.27.82:1387
1 218.14.27.82:1388
1 218.14.27.82:1389
1 218.14.27.82:1390
1 218.14.27.82:1391
1 218.14.27.82:1392
1 218.19.11.222:2651
1 218.19.197.36:41785
1 218.204.81.34:37174
1 218.21.128.42:13640
1 218.242.1.189:4206
1 218.242.1.189:4207
1 218.26.191.66:4761
1 218.26.243.18:2158
1 218.59.153.112:1094
1 218.59.59.56:1216
1 218.61.43.231:1700
1 218.64.248.82:51831
1 218.74.137.176:1245
1 218.90.109.30:3564
1 218.90.109.30:3565
#7
CoolQ() 你是干什么工作的?可以留下QQ吗?
#8
哦,我明白错在哪里了,你需要把218.90.109.30:3565再分成两部分,再进行统计。
工作不敢当,我现在还是学生。
工作不敢当,我现在还是学生。