Terminal checks can go stale while you read their output. The Linux watch command reruns a command at intervals and displays its current output in a terminal.
In this piece, I’ll show you how to set a refresh interval and watch the output of a command pipeline.
TL;DR
The Linux watch command runs a command repeatedly and shows its current output in a terminal. Use it for a live check, not as a detached monitoring job.
- Leave the interval unset for its 2-second default.
- Choose a slower interval or compare visible changes when useful.
- Quote a pipeline and press Ctrl+C to stop.
What Is the Linux watch Command?
watch is a procps-ng utility that runs a command and displays its output in a full-screen terminal. It runs every 2 seconds by default and continues until interrupted or told to exit.
The command form is:
watch [options] command
How to Use the watch Command Step by Step
Choose the command whose latest result you need to inspect. Confirm the utility first, then set an interval or display option that fits that check.
Step 1: Check the installed watch version
Run the version query first. It prints the locally installed procps-ng build and exits.
watch --version
watch from procps-ng 4.0.4

Consult the local manual when an option differs between releases.
Step 2: Use the default interval or set your own
Leave the interval unset for its 2-second default, or add -n and a number of seconds for a slower refresh.
watch date
watch -n 5 df -h
Step 3: Compare output and choose when to exit
Use -d to highlight lines that differ between updates. To retain a change highlight in later refreshes, attach =permanent directly to the option.
watch -d=permanent -n 2 free
watch -g 'date +%S'
watch -e false
The next command exits when visible output changes. The last freezes after a nonzero result and waits for a key press.
Step 4: Watch a pipeline
Quote the whole pipeline so the outer shell leaves its pipe for watch.
watch -n 2 'df -h | head -n 5'
The pipeline limits the report to 5 lines, which helps when the full output will not fit on screen.
watch Command Limits and Common Problems
Choose the option by the condition that should change the display or end the check.
| Need | Option | Effect |
|---|---|---|
| Hide the header | -t | Leaves command output on screen without the usual header. |
| Beep after an error | -b | Requests a beep when the command returns a nonzero status. |
| Exit on visible change | -g | Stops when displayed output changes, not when a change is off-screen. |
| Freeze after an error | -e | Stops refreshing after a nonzero result and exits after a key press. |
watch -t date
watch -b false
watch displays only what fits its terminal area, so resizing the window can change which differences are visible. Programs that need interactive input or terminal control may also display poorly, so use a non-interactive reporting mode when one is available.
The -p option schedules runs from the previous command’s start time. A slow command still has to finish before the next run begins, and intervals below 0.1 seconds are bounded by watch. Choose it when drift would affect the check, since routine status checks can use the ordinary interval.
watch -p -n 5 date
Conclusion: Use watch for Live Terminal Checks
Use the local manual for release-specific option details. These LinuxForDevices guides cover related command-line tasks:
- The man command opens local manual pages.
- The date command formats timestamps for recurring checks.
- The df command reports mounted-filesystem capacity.
- The head command limits output to its opening lines.
- The tail command follows newly appended log lines.
FAQ
These answers cover stopping watch and using more than one command.
How do I stop the watch command in Linux?
Press Ctrl+C in the terminal running watch. The display stops and the shell prompt returns.
Can I run two commands with watch?
Yes. Put them in a shell pipeline and quote the full pipeline, for example watch ‘command1 | command2’.
Can watch run in the background?
watch is designed for an interactive terminal display. Use a scheduler or service for checks that must continue without an open terminal.
Can watch use a fractional interval?
Yes. Current procps-ng permits intervals down to 0.1 seconds. A command still must finish before another run begins.
