watch Run a command repeatedly and show its output
Runs a command again and again, clearing the screen each time, so you can see how its output changes. You reach for it to follow a file size, a queue or a service status without retyping the command. Press Ctrl+C to stop it.
Synopsis
watch [-n SECONDS] [-d] COMMAND
Common options
| Option or form | What it does |
|---|---|
-n SECONDS | Seconds to wait between runs. The default on Linux is 2 |
-d | Highlight what changed since the previous run |
-t | Turn off the header that shows the interval and the command |
-b | Beep if the command exits with a non-zero status |
-e | Stop and wait for a key press if the command exits with an error |
-g | Exit when the command's output changes |
Examples
watch df -h
watch -n 10 'ls -l /var/log'
watch -d 'ls -l app.log'
watch -n 1 'ps aux | grep -c [n]ginx'
while true; do clear; date; df -h; sleep 2; done
Notes
- watch is not installed on macOS. You can add it with Homebrew (brew install watch). The options on this page are for the procps version, which is the one on most Linux systems and the one Homebrew installs.
- watch is interactive and never ends by itself. Press Ctrl+C to quit.
- Quote a command that contains pipes or redirects, as in the examples, or your shell will apply them to watch instead of the command.
- watch runs the command through sh -c, so shell syntax works but your aliases and shell functions do not.
- For one process, top gives a live view. To follow a growing file, tail -f is simpler than watch.
See also
Last reviewed 2026-10-07.