N1 Network Command-ping
Ping
Parameter-c specifies the number of times
Root@ubuntu17:~# ping-c 2 www.baidu.comPING www.a.shifen.com (111.13.100.92) 56 (84) bytes of data.64 bytes from 111.13.100.92 (111.13.100.92): icmp_seq=1 ttl=51 time=19.0 ms64 bytes from 111.13.100.92 (111.13.100.92): icmp_seq=2 ttl=51 time=17.9 ms--- www.a.shifen.com ping statistics-2 packets transmitted, 2 received, 0 packet loss Time 1000msrtt min/avg/max/mdev = 17.998, 18.526, 19.054, 0.528 ms
The parameter-Q only depends on the result.
Root@ubuntu17:~# ping-Q www.baidu.com-c 2PING www.a.shifen.com (111.13.100.91) 56 (84) bytes of data.--- www.a.shifen.com ping statistics-2 packets transmitted, 2 received, 0 packet loss, time 1000msrtt min/avg/max/mdev = 11.622 packet loss 11.786 ms 11.951 ms
The parameter-s specifies the ping packet size
Root@ubuntu17:~# ping-s 65500-c 2 www.baidu.comPING www.a.shifen.com (111.13.100.92) 65500 (65528) bytes of data.--- www.a.shifen.com ping statistics-2 packets transmitted, 0 received, 100% packet loss, time 1022ms
The parameter-t specifies the time to live
Root@ubuntu17:~# ping-t 10 www.yahoo.com-c 2PING atsv2-fp.wg1.b.yahoo.com (124.108.103.104) 56 (84) bytes of data.From r4105-s2.tp.hinet.net (220.128.10.198) icmp_seq=1 Time to live exceededFrom r4105-s2.tp.hinet.net (220.128.10.198) icmp_seq=2 Time to live exceeded--- atsv2-fp.wg1.b.yahoo.com ping statistics-2 packets transmitted, 0 received, + 2 errors, 100% packet loss Time 1001ms
The parameter-I specifies the interval of the ping
Root@ubuntu17:~# ping-I 0.1-c 10 www.baidu.comPING www.a.shifen.com (111.13.100.91) 56 (84) bytes of data.64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=1 ttl=51 time=11.8 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=2 ttl=51 time=11.8 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_ Seq=3 ttl=51 time=11.7 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=4 ttl=51 time=11.7 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=5 ttl=51 time=11.7 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=6 ttl=51 time=11.6 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=7 ttl=51 time=11.7 ms64 bytes from 111.13. 100.91 (111.13.100.91): icmp_seq=8 ttl=51 time=11.7 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=9 ttl=51 time=11.7 ms64 bytes from 111.13.100.91 (111.13.100.91): icmp_seq=10 ttl=51 time=11.7 ms--- www.a.shifen.com ping statistics-10 packets transmitted 10 received, 0% packet loss, time 1156msrtt min/avg/max/mdev = 11.671 ms 11.752 ms
Parameter-f flood flooding
Root@ubuntu17:~# ping-f-c 100 www.baidu.comPING www.a.shifen.com (111.13.100.92) 56 (84) bytes of data.--- www.a.shifen.com ping statistics-100 packets transmitted, 100 received, 0% packet loss, time 1584msrtt min/avg/max/mdev = 17.319 ms 19.847 ms, pipe 2, ipg/ewma 16.000 ms 17.831 ms