# Waiting for Things: watch, until and timeout

watch reruns a command every few seconds and shows its latest result, an until loop waits until a server answers, and timeout stops a command that takes too long, with exit code 124, so a script never waits forever.

![Cheat sheet for the lesson Waiting for Things: watch, until and timeout: watch reruns a command every few seconds and shows its latest result, an until loop waits until a server answers, and timeout stops a command that takes too long, with exit code 124, so a script never waits forever.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/b6fdbf72bfd249a7a94d52b8e7a4b554.webp)

- Category: Bash
- Level: Journeyman
- Tags: exit-code, linux, polling, timeout, unix, until-loop, watch
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-watch-and-wait-cheat-sheet
