Forever & AlwaysLINUX COMMAND ATLAS

LINUX COMMAND ATLAS · COMMAND GUIDE

Linux ping command

Send diagnostic echo requests to test network reachability.

iputils

Syntax

Command form
ping [OPTION]... DESTINATION

Common options

7 options
OptionWhat it does
-c COUNTStop after sending COUNT requests.
-i INTERVALWait INTERVAL seconds between requests.
-s SIZESet the number of payload bytes.
-W TIMEOUTWait TIMEOUT seconds for a response.
-I INTERFACE|ADDRESSSet the outgoing interface or source address.
-nDo not resolve addresses to hostnames.
-4 / -6Use IPv4 or IPv6 only.

Usage examples

2 examples

Send diagnostic echo requests to test network reachability.

ping -c 4 example.com

Send three requests through eth0 (if permitted).

ping -I eth0 -c 3 192.0.2.1

Notes

A failed ping does not prove a host is down; firewalls may block ICMP. Availability, syntax and permissions vary by system.