Skip to content

ping command

Check whether a host is reachable and measure latency.

  • Networking
  • Package iputils-ping
  • 6 options · 5 examples
On this page

Syntax

ping [options] host

Provided by the iputils-ping package. Run man ping for the full manual.

Common options

OptionWhat it does
-c NSend N packets and stop
-i SECSeconds between packets
-W SECWait time for each reply
-s SIZEPacket size in bytes
-4 / -6Force IPv4 or IPv6
-qOnly print the summary

Examples

  1. Ping until you press Ctrl+C

    ping example.com
  2. Send 4 packets

    ping -c 4 8.8.8.8
  3. Quiet summary only

    ping -c 10 -q example.com
  4. IPv6

    ping -6 example.com
  5. Check in a script

    ping -c 1 -W 2 192.0.2.10 > /dev/null && echo up || echo down

ping guides

← All Linux commands · Suggest a fix

Back to top