您好,登錄后才能下訂單哦!
這篇文章主要介紹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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。