Network

The ping command

Checks whether a host responds and how long it takes.

Syntax

ping [-c N] <host>

Most useful options

-c NSends N packets and finishes
-i SOne packet every S seconds
-W SMaximum wait time

Copy-ready examples

$ ping miguelacm.esDoes it respond?
$ ping -c 2 8.8.8.8Two packets and finish

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • Without -c it loops: stop it with Ctrl+C.

Related commands

FAQ

Ping responds but the web does not load?

It may be DNS or the web service; ping only tests the basic connection.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course