Refresh a command's output in the terminal so you can watch changes happen in real time. 28.05.2026 | reading time: 2 min Want to observe a command's output without retyping it every few seconds? "watch" reruns a command at regular intervals and refreshes the screen so the changes jump out at you. Keep an Eye on Logs Scenario: a server shows intermittent errors; watch helps spot when they appear and disappear. Example command and sample output shown below: ```bash watch -n 2 "tail -n 5 /var/log/syslog" Every 2.0s: tail -n 5 /var/log/syslog May 28 10:14:01 host systemd[1]: Started Session 1234 of user root. May 28 10:14:03 host myapp[2345]: ERROR: Connection timed out May 28 10:14:05 host myapp[2345]: Retrying connection May 28 10:14:07 host myapp[2345]: Connected ``` Options That Change Behavior Different flags tailor watch to the job; try them and watch the difference. Examples: ```bash watch -n 1 -d "ss -tuln" watch -t "date" watch -g "pgrep nginx" ``` When To Use Alternatives Sometimes a continuous stream is better than repeated snapshots, or you need event-driven updates; use these tools instead. Examples: ```bash tail -f /var/log/syslog journalctl -f -u myunit.service top ``` Practical Tips for Real Work Combine watch with pipeline commands, use short intervals sparingly to avoid load, and prefer targeted queries to keep output compact and meaningful; try "watch -n 5 'ps aux | grep myservice'" and adjust until the output highlights the change you care about. Next Steps Mastering watch boosts troubleshooting speed and situational awareness in the terminal; keep experimenting with flags and pair it with tools like tail or inotify for richer monitoring, and consider formalizing skills with Linux certificates at bitsandbytes.academy for deeper, exam-focused training. Join Bits & Bytes Academy First class LINUX exam preparation. utilities processes troubleshooting scripting