Ping an IP address or hostname in the Terminal for Mac OS X

Ping an IP address or hostname in the Terminal for Mac OS X

Syntax:ping [-Options] <ip/hostname>

Usage:Ping’s an IP-address or a hostname (which can be used to troubleshoot connection problems to another computer or a server).

Options

-c <num>Stop after sending and receiving <num> number of packets.
-fFlood ping: Flood ping, output packets as fast as they come back or 100 times per second.
-i <num>Wait for <num> seconds between sending each packet.

Example

ping 127.0.0.1Ping your own computer (localhost)
ping -c 10 google.sePing google.se and stop after 10 sent and received packages.

Quick tip

If you’re using ping and the response keeps coming in without stopping. Hold down “Ctrl” and hit “Z” (Ctrl+Z) to abort.

More to read: System info and preferences from the Terminal in Mac OS X