watch [options] commandArguments explained
- -n sets interval seconds.
- -d highlights differences.
Common examples
watch -n 2 df -hRefreshes disk usage every two seconds.
watch -d 'ss -tln'Shows listening TCP sockets and highlights changes.
| Field | Details |
|---|---|
| Command | watch |
| Category | Logs and Diagnostics |
| Primary use | Runs a command repeatedly and shows changing output. |
| Syntax | watch [options] command |