Linux administrators and everyday Linux users often need to run the same command repeatedly while waiting for something to change.

You might be checking disk space during a file copy, waiting for a service to start, or watching network connections while troubleshooting.

Running the same command every few seconds quickly becomes repetitive, and it’s easy to miss an important change.

That’s where the watch command comes in.

It automatically reruns any Linux command at regular intervals and refreshes the output on your screen.

It can even highlight what changed between updates, making it easy to monitor your system in real time without writing a shell script.

For example, you’ve probably run df -h, waited a few seconds, and run it again while a large file copy or backup was in progress.

Instead of doing that manually, watch can rerun the command for you and update the display automatically, so you can easily see what’s changing.

In this guide, you’ll learn how to use the watch command with practical examples to monitor disk usage, services, log files, and other system activity directly from the terminal.

The watch command repeatedly runs another command at a fixed interval and refreshes the terminal with the latest output.

By default, it reruns the command every 2 seconds, making it useful for monitoring system activity without repeatedly typing the same command.

The watch utility is included in the procps package on Debian-based distributions and procps-ng on RHEL-based distributions.

It’s installed by default on most Linux systems, but if which watch doesn’t return a path, install it using the appropriate package manager for your distribution.

On Ubuntu/Debian:

On RHEL/Rocky Linux:

This guide was tested on Ubuntu 26.04 and Rocky Linux 10, but the watch command works the same way on most modern Linux distributions.

The basic syntax is:

By default, watch reruns the specified command every 2 seconds and refreshes the screen with the latest output.

For example:

Here:

Press Ctrl+C at any time to stop watch.

The output is displayed only while watch is running.

Because it refreshes the screen instead of keeping a history, the output isn’t saved anywhere unless you explicitly redirect it to a file or use a logging tool.

Suppose you’re copying a large file from /tmp to a mounted NFS share and want to monitor the available disk space on both the source and destination filesystems.

Here:

As the copy progresses, you’ll see the Used space increase and the Avail space decrease on the destination filesystem as data is written.

Monitoring both filesystems helps you confirm that the copy is progressing and lets you spot low disk space before the operation fails.

Suppose you’re troubleshooting a service that unexpectedly opens or closes network ports.

Instead of manually comparing the output of ss every few seconds, you can let watch highlight the changes for you.

Here’s what the options mean:

As services start, stop, or open new connections, watch highlights the affected lines so you can immediately see what changed without manually comparing each refresh.

When you’re monitoring a system under heavy load, the default 2-second refresh interval may not be frequent enough to catch rapid changes, such as CPU temperature spikes.

The -n option accepts fractional seconds, allowing you to monitor changes more frequently.

However, the actual refresh rate depends on how long the command takes to run.

For example, if sensors takes 400 milliseconds to complete, setting the interval to 0.1 seconds won’t make the output update any faster.

After restarting a service, you may want to wait until it’s fully running before performing the next task.

Instead of repeatedly checking its status yourself, watch can stop automatically as soon as the output changes.

Here’s what each option does:

As soon as the service changes from its initial state, for example, from activating to active—watch exits automatically.

This is useful when you want to wait for a service to become ready before running another command.

For example:

Once the service becomes active, watch exits, and the next command runs automatically.

After updating a web server or reverse proxy configuration, you may want to keep an eye on the error log while sending test requests.

Instead of repeatedly running tail, you can use watch to refresh the latest log entries automatically.

Here’s what the command does:

This isn’t a replacement for tail -f, which continuously streams new log entries and preserves everything as it arrives.

Instead, watch gives you a refreshed snapshot of the latest log output, making it useful for quickly checking whether new errors are appearing while you test a configuration change.

Here are a few common mistakes to avoid when using the watch command:

The watch command isn’t the only way to rerun a command, but it’s often the simplest when you want to monitor something interactively.

A Bash loop such as:

can repeatedly run a command, but it requires writing a script or typing a loop.

For quick, interactive monitoring, watch does the same job with a single command.

A cron job serves a different purpose.

It’s designed to run commands automatically at scheduled times, usually every few minutes or hours, even when you’re not logged in.

It’s not intended for continuously refreshing output on your terminal.

Use watch when you want to monitor a command in real time and stop it as soon as you’re done.

If you need to save the output, send alerts, or run commands automatically in the background, a Bash script or cron job is a better choice.

The watch command makes it easy to monitor changes by automatically rerunning any Linux command at regular intervals.

Whether you’re checking disk usage, watching a service start, or monitoring log files, it gives you a live view without writing a script.

You also learned how to refresh commands at custom intervals with -n, highlight changes with -d, and automatically exit when the output changes using -g.

The next time you find yourself running the same command over and over, try using watch instead.

It’s a simple tool that can save time and make system monitoring much easier.

How do you use the watch command in your daily workflow? Let us know in the comments if you have a favorite use case or a helpful tip to share with other Linux users.

15 Bash (!) Operator Examples Every Linux User Should Know

9 Deprecated Linux Networking Commands and Alternative Tools You Should Use

Try uutils-coreutils: Rust Alternative to GNU Coreutils

How to Downgrade and Lock Packages With dnf in RHEL Systems

5 Ways to Check Remote Port Connectivity in Linux

How to Resize ext4 Partitions and Filesystems in Linux

pyDash – A Web Based Linux Performance Monitoring Tool

Suricata – A Intrusion Detection, Prevention, and Security Tool

GoAccess (A Real-Time Apache and Nginx) Web Server Log Analyzer

How To Install and Connect an Agent to Pandora FMS Server

CoreFreq – A Powerful CPU Monitoring Tool for Linux Systems

BCC – Tracing Tools for Linux IO, Networking, Monitoring, and More

Manage Log Messages Under Systemd Using Journalctl [Comprehensive Guide]

7 Interesting ‘sort’ Command Examples in Linux – Part 2

Stop Using Only cd: Learn pushd, popd, and zoxide in Linux

Todo.txt – Manages Your Todo Tasks from Linux Terminal

Progress – Show Percentage of Copied Data for (cp, mv, dd, tar) Commands

How to Use /proc File System to Monitor Linux System

11 Best Self-Hosted Alternatives to Google Photos

Top Cross-Platform Apps for Linux, Windows, and Mac in 2025

6 Most Notable Open Source Centralized Log Management Tools

10 Best Open Source Forum Software for Linux in 2024

11 Best GitHub Alternatives to Host Open Source Projects

10 Tools to Monitor Linux Disk Partitions and Usage in Linux

**📚 Original Source:**
[How to Use the watch Command in Linux to Monitor Commands in Real Time](https://www.tecmint.com/watch-command-in-linux/)

About The Author