Quick Tip
Taming `watch`: Real-time Command Output Made Easy
Challenge: You need to monitor the output of a command repeatedly to observe changes in real-time, such as disk usage, network traffic, or process status, without manually re-running the command.
The Solution: Use the `watch` command.
watch -n 5 df -h
Why it works: The `watch` command executes a given command at regular intervals (defaulting to every 2 seconds). The `-n 5` option sets the interval to 5 seconds, and `df -h` displays disk space in a human-readable format. The output is updated on your terminal, allowing you to observe changes live.
Pro-Tip: Use `watch -d` to highlight the differences between updates.
Linux Tips & Tricks | © ngelinux.com | 5/3/2026
