watch

Repeatedly execute a command at intervals and display output.

low risk

interactive breakdown — edit the command and press Explain
$ 
⚠ Risks & cautions
What it does

watch runs a command every N seconds (default 2) and displays its output full-screen, highlighting changes. Perfect for monitoring dynamic state like pod counts, resource usage, or deployment rollouts without writing a custom loop.

Common flags
FlagMeaning
-n --intervalSet update interval in seconds
-d --differencesHighlight changes since last update
-g --chgexitExit when output changes
-e --errexitFreeze on command error
Examples
watch -n 2 'kubectl get pods'Monitor pod status every 2 seconds · explain & risk-check →
watch -d -n 1 'df -h /var'Watch disk usage with change highlighting · explain & risk-check →
watch -n 5 'ss -tunlp | grep :8080'Watch for port listener · explain & risk-check →
watch -g 'kubectl get deploy myapp -o jsonpath="{.status.readyReplicas}"'Exit when deployment scale changes · explain & risk-check →
Pro tip

Use `watch -d` during rolling deployments to instantly spot when pod statuses change — the highlighting makes it obvious without having to scan all rows manually.

Related
tail top journalctl
Open the full explainer →More in System & Processes

Reference text is hand-written and may be incomplete — check man watch for your version. Test destructive commands on a non-production system first.