Run a continuous ping with timestamps on Linux

Keep pinging a host until interrupted while printing a Unix timestamp on every reply — perfect for correlating packet loss with events.

LinuxpinglatencyDiagnosticsLow risk
Run `ping -D 8.8.8.8` to ping continuously and prefix each reply with a Unix timestamp; press Ctrl+C to stop.

01Command

Command
$ ping -D 8.8.8.8

02What it does

A plain `ping host` also runs forever, but its output has no timestamps, so you can't tell later which minute the 10% loss happened in. The `-D` flag prints a Unix-epoch timestamp before every line, making logs easy to cross-reference with cron jobs, reboots, or ISP outage reports. Combine with `-i 5` to slow the interval or `-c 100` to stop after a fixed number of probes.

03Risk

RiskLow risk
Requirementsiputils-ping
!Warning: Ping runs indefinitely with this syntax — in a script always pair it with `-c` or a `timeout` so it can't hang.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Network

06Related solutions