Linux for Developers Course
Linux for Developers
/
Beginner

ping

Definition

A network utility used to test the reachability of a host on an IP network and measure the round-trip time for messages sent.

Explain Like I'm New

Sonar for computers. You yell 'Marco' at a server, and you wait to see if it yells 'Polo' back, and how many milliseconds it takes.

Real World Example

The company website is down. The admin types `ping 8.8.8.8` to see if their own laptop has internet. It succeeds. They type `ping company.com`. It fails. They know the problem is the company server, not their laptop.

Common Use Cases

  • •Basic network troubleshooting
  • •Checking latency

Interview Questions

basic

  • If you type `ping google.com` on Linux, will it automatically stop after 4 pings like it does on Windows?

intermediate

  • What underlying protocol does the `ping` command actually use?

Flash Cards

Question

Does it stop automatically?

Click to reveal answer
Answer

No. On Linux, `ping` runs infinitely forever until you manually forcefully stop it by pressing `Ctrl+C`.

Question

Which protocol?

Click to reveal answer
Answer

ICMP (Internet Control Message Protocol). It does NOT use TCP or UDP.