maux
Star on GitHub Buy me a coffee

Manual / timeout

timeout(1)

TIMEOUT(1) General Commands Manual TIMEOUT(1)

timeout - run a utility, kill it if it outruns a deadline

timeout [ -fp ] [ -k time ] [ -s signal ] duration utility [ argument ] ...

Timeout runs utility and waits up to duration seconds for it to exit. If it has not exited by then, signal (default TERM) is sent to it, and timeout exits 124 once it is reaped. Duration and time are decimal integers with an optional trailing s, m, or h suffix (default seconds).

Utility is resolved against PATH exactly as a shell resolves a bare command word (execvp), and its argv[0] is the word as typed, not the resolved path.

Foreground: accepted and does nothing. There is no process-group concept on this machine for it to skip.
If signal alone does not reap utility within time more seconds, send it KILL as well.
Preserve status: exit with utility's own status even after a timeout, instead of 124.
Send signal instead of TERM. A decimal number or one of the names TERM, KILL, HUP, INT, QUIT.

/usr/man/TIMEOUT this page

sh(1), kill(1), nohup(1), sleep(1)

If utility was invoked, its own exit status, unless it timed out and -p was not given, in which case 124. Otherwise: 125 on a bad duration or option, or if fewer than two operands remain after options; 126 if utility was found but could not be run; 127 if it could not be found on PATH.

There is no interval timer on this machine: the deadline is a tick count sampled and polled, backed by an AppleMouse VBL or Mockingboard tick source. A machine with neither refuses with a diagnostic (exit 125) rather than hanging. A fractional duration (such as 1.5) is refused rather than truncated or rounded.

September 15, 2026 maux