UnixDroid

Network · Linux command

ping command in Linux

What does ping do?

ping checks whether a host is reachable by sending ICMP echo packets and measuring how long the replies take.

ping [-c N] host

Most useful options

OptionWhat it does
-c Nsend N packets then stop
-iinterval between packets

ping examples

$ ping -c 4 google.com Try it ›

is the internet up?

$ ping 10.10.10.5 Try it ›

is the lab target up?

In security work

Many firewalls block ping, so a host that does not answer may still be up.

Questions about ping

How do I stop ping?

Press Ctrl+C, or use -c to send a fixed number of packets.