全部博文(136)
分类: LINUX
2009-06-13 15:56:16
[dwapp@dw_testdb yuechaotian]$ cat ping.txt
64 bytes from 1.2.3.2: icmp_seq=0 ttl=60 time=0.655 ms
64 bytes from 1.22.3.2: icmp_seq=1 ttl=60 time=0.328 ms
64 bytes from 1.2.3.2: icmp_seq=2 ttl=60 time=0.292 ms
64 bytes from 1.22.3.2: icmp_seq=3 ttl=60 time=0.311 ms
64 bytes from 1.2.3.2: icmp_seq=4 ttl=60 time=0.316 ms
64 bytes from 1.2.3.2: icmp_seq=0 ttl=60 time=0.655 ms
64 bytes from 1.2.3.2: icmp_seq=0 ttl=60 time=0.655 ms
64 bytes from 1.22.3.2: icmp_seq=1 ttl=60 time=0.328 ms
64 bytes from 1.2.3.2: icmp_seq=2 ttl=60 time=0.292 ms
64 bytes from 1.22.3.2: icmp_seq=3 ttl=60 time=0.311 ms
64 bytes from 1.2.3.2: icmp_seq=4 ttl=60 time=0.316 ms
64 bytes from 1.22.3.2: icmp_seq=1 ttl=60 time=0.328 ms
64 bytes from 1.2.3.2: icmp_seq=2 ttl=60 time=0.292 ms
64 bytes from 1.22.3.2: icmp_seq=3 ttl=60 time=0.311 ms
64 bytes from 1.2.3.2: icmp_seq=4 ttl=60 time=0.316 ms
64 bytes from 1.22.3.2: icmp_seq=3 ttl=60 time=0.311 ms
64 bytes from 1.22.3.2: icmp_seq=3 ttl=60 time=0.311 ms
64 bytes from 1.2.3.2: icmp_seq=4 ttl=60 time=0.316 ms
64 bytes from 1.2.3.2: icmp_seq=4 ttl=60 time=0.316 ms |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}'
1.2.3.2: time=0.655
1.22.3.2: time=0.328
1.2.3.2: time=0.292
1.22.3.2: time=0.311
1.2.3.2: time=0.316
1.2.3.2: time=0.655
1.2.3.2: time=0.655
1.22.3.2: time=0.328
1.2.3.2: time=0.292
1.22.3.2: time=0.311
1.2.3.2: time=0.316
1.22.3.2: time=0.328
1.2.3.2: time=0.292
1.22.3.2: time=0.311
1.2.3.2: time=0.316
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.2.3.2: time=0.316
1.2.3.2: time=0.316 |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}' | grep 22
1.22.3.2: time=0.328
1.22.3.2: time=0.311
1.22.3.2: time=0.328
1.22.3.2: time=0.311
1.22.3.2: time=0.328
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.22.3.2: time=0.311 |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}' | grep -v 22
1.2.3.2: time=0.655
1.2.3.2: time=0.292
1.2.3.2: time=0.316
1.2.3.2: time=0.655
1.2.3.2: time=0.655
1.2.3.2: time=0.292
1.2.3.2: time=0.316
1.2.3.2: time=0.292
1.2.3.2: time=0.316
1.2.3.2: time=0.316
1.2.3.2: time=0.316 |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}' | grep 22 | sort
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.22.3.2: time=0.311
1.22.3.2: time=0.328
1.22.3.2: time=0.328
1.22.3.2: time=0.328 |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}' | grep 22 | sort | uniq
1.22.3.2: time=0.311
1.22.3.2: time=0.328 |
[dwapp@dw_testdb yuechaotian]$ cat ping.txt | awk '{print $4"\t"$7}' | grep 22 | sort | uniq -c
5 1.22.3.2: time=0.311
3 1.22.3.2: time=0.328 |
chinaunix网友2009-06-15 13:07:07
最后一个应该是 select count(*), ip, time from ping where ip like '%22%' order by time group by ip,time 吧