Copied to clipboard

ping

Ping is a command-line tool used to test network connections between hosts. It sends a series of data packets to a specified target address and monitors response time and packet loss to detect network connectivity stability and speed.
Domain or IP address

Example

  • Checking network connections: The ping command can be used to test whether network connections between hosts are available. For example, you can send packets to Google to test whether Internet connections are normal:
    ping www.google.com
    
  • Checking network latency: The ping command can also be used to test network latency. For example, you can send multiple packets to a host and calculate the average response time:
    ping -c 10 www.baidu.com
    
  • Tracing network routes: The ping command can be used to trace the route of packets from the source host to the destination host. For example, you can use the t parameter to continuously ping the destination host and view the routers passed in the middle:
    ping -t www.qq.com
    
  • Checking network stability: The ping command can also be used to check the stability of network connections. For example, you can send a large number of packets to the target host to test whether network connections will be lost:
    ping -c 1000 www.taobao.com
    
  • Checking network bandwidth: The ping command can also be used to test network bandwidth. For example, you can send a large number of packets to the target host and calculate the amount of data sent per second:
    ping -s 1472 -M do -c 100 www.163.com | awk '/packets/{print $8 $9}'