Skip to content

Linux watch Guide

Mattscreative edited this page Dec 5, 2025 · 2 revisions

Linux watch Guide

Complete beginner-friendly guide to watch on Linux, covering Arch Linux, CachyOS, and other distributions including monitoring commands, periodic execution, and real-time monitoring.


Table of Contents

  1. Understanding watch
  2. watch Basics
  3. Monitoring Commands
  4. Update Intervals
  5. Troubleshooting

Understanding watch

What is watch?

watch executes command periodically.

Uses:

  • Monitor commands: Watch command output
  • Periodic execution: Run commands repeatedly
  • Real-time monitoring: Monitor in real-time
  • System monitoring: Monitor system status

Why it matters:

  • Monitoring: Monitor command output
  • Real-time updates: See updates in real-time
  • System observation: Observe system changes

watch Basics

Watch Command

Basic usage:

# Watch command (default: 2 seconds)
watch command

# Updates every 2 seconds

Custom Interval

Set interval:

# Custom interval (5 seconds)
watch -n 5 command

# -n = interval (seconds)

Monitoring Commands

System Monitoring

Monitor system:

# Monitor processes
watch -n 1 'ps aux | head -20'

# Monitor disk usage
watch -n 2 df -h

# Monitor memory
watch -n 1 free -h

Highlight Changes

Show differences:

# Highlight changes
watch -d command

# -d = differences (highlights changes)

⏱ Update Intervals

Fast Updates

Quick updates:

# Update every second
watch -n 1 command

# Very fast updates

Slow Updates

Slower updates:

# Update every 10 seconds
watch -n 10 command

# Less frequent updates

Troubleshooting

watch Not Found

Check installation:

# Check watch
which watch

# Install if missing
sudo pacman -S procps-ng

Summary

This guide covered watch usage, command monitoring, and periodic execution for Arch Linux, CachyOS, and other distributions.


Next Steps


This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.

Clone this wiki locally