您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
这篇文章主要介绍Linux系统如何使用ping命令判断网络好坏,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!
命令格式
ping [参数] [主机名或者IP地址]
使用范例
不加任何参数
如果不加任何参数,查看是否ping通
➜ ~ ping www.baidu.com PING www.a.shifen.com (115.239.210.27) 56(84) bytes of data. 64 bytes from 115.239.210.27: icmp_seq=1 ttl=52 time=6.06 ms 64 bytes from 115.239.210.27: icmp_seq=2 ttl=52 time=5.56 ms 64 bytes from 115.239.210.27: icmp_seq=3 ttl=52 time=5.67 ms 64 bytes from 115.239.210.27: icmp_seq=4 ttl=52 time=5.82 ms 64 bytes from 115.239.210.27: icmp_seq=5 ttl=52 time=5.70 ms 64 bytes from 115.239.210.27: icmp_seq=6 ttl=52 time=5.79 ms --- 192.168.254.44 ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 3999ms rtt min/avg/max/mdev = 0.152/0.159/0.172/0.017 ms
发送指定数目
可以通过 参数-c 来发送指定数目的包后停止
➜ ~ ping www.baidu.com -c 5 PING www.a.shifen.com (115.239.211.112) 56(84) bytes of data. 64 bytes from 115.239.211.112: icmp_seq=1 ttl=52 time=6.03 ms 64 bytes from 115.239.211.112: icmp_seq=2 ttl=52 time=5.96 ms 64 bytes from 115.239.211.112: icmp_seq=3 ttl=52 time=5.79 ms 64 bytes from 115.239.211.112: icmp_seq=4 ttl=52 time=5.79 ms 64 bytes from 115.239.211.112: icmp_seq=5 ttl=52 time=6.21 ms --- www.a.shifen.com ping statistics --- 5 packets transmitted, 5 received, 0% packet loss, time 4007ms rtt min/avg/max/mdev = 5.791/5.958/6.215/0.186 ms
设定发送间隔
可以通过 参数 -c 数目:在发送指定数目的包后停止
➜ ~ ping www.baidu.com -c 5 -i 2 PING www.a.shifen.com (115.239.211.112) 56(84) bytes of data. 64 bytes from 115.239.211.112: icmp_seq=1 ttl=52 time=6.06 ms 64 bytes from 115.239.211.112: icmp_seq=2 ttl=52 time=5.84 ms 64 bytes from 115.239.211.112: icmp_seq=3 ttl=52 time=5.98 ms ^C --- www.a.shifen.com ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 4005ms rtt min/avg/max/mdev = 5.842/5.965/6.068/0.112 ms
以上是“Linux系统如何使用ping命令判断网络好坏”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。