ping — check whether packets reach a host
cheat sheet · Ubuntu 24.04 · iputils 20240117 https://lab.dimsanych.ru/en/wiki/ping/Cheat sheet
-
ping -c 3 192.0.2.1three requests and a summary; else Ctrl+C -
ping -c 3 -W 1 192.0.2.1wait at most a second for each reply -
ping -c 3 -n 192.0.2.1no name lookups — faster and cleaner -
ping -c 3 -I lab0 192.0.2.1through a given interface -
ping -c 10 -q 192.0.2.1only the final statistics -
ping -c 3 -O 192.0.2.1report every request left unanswered -
ping -4 -c 3 example.comIPv4 only; -6 for IPv6 only -
sudo ip netns exec lab-client ping -c 2 192.0.2.1from a namespace
Options
Without -c, Linux ping runs forever — unlike Windows, which sends four requests by
default. Full list — man ping.