Monitor Command Output with watch -d

watch re-runs a command on an interval and -d highlights differences between refreshes — a poor man's live dashboard.

LinuxwatchmonitoringcliLow risk
Run `watch -d -n 2 free -h` to refresh memory usage every 2 seconds with changes highlighted; press Ctrl+C or q to quit.

01Command

Command
$ watch -d -n 2 free -h

02What it does

watch takes over the terminal, clears it, and reruns the given command at the -n interval (default 2 seconds), which turns any one-shot command into a live monitor. The -d flag highlights what changed since the last refresh, and -d=cumulative keeps highlighting everything that has ever changed. Quote carefully: the whole pipeline must be passed to watch, e.g. `watch -n 5 'df -h / | tail -1'`.

03Risk

RiskLow risk
Requirementsprocps package; preinstalled on virtually all distributions.

04Undo

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

05Sources

  • watch(1) - execute a program periodically
    man7.org Linux man-pages · technical · 2026-09-17
    Evidence: watch runs command repeatedly, showing its output and errors; -d, --differences highlights the changes; -n, --interval seconds specifies the update interval.

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions