TIMEOUT(1) General Commands Manual TIMEOUT(1)

timeoutrun a command with a time limit

timeout [-fp] [-k duration] [-s SIGNAL] duration command [argument...]

The timeout utility executes command and terminates it, if still running after duration.

duration is a non-negative decimal number including floats, optionally followed by a suffix: s for seconds (default), m for minutes, h for hours.

Disables killing child processes.
duration
Enables sending a SIGKILL after duration.
Preserve (mimic) the wait status of command, even after duration.
SIGNAL
Signal to be sent on timeout, by default SIGTERM is sent. Signal may be a name like 'HUP' or 'SIGHUP', or a number like '9'.

A list of signals may be obtained with kill -l.

The timeout utility may return one of the following statuses:

124
Timeout reached
125
Error within timeout
126
Failed to execute command

Otherwise, the exit status of command is returned.

kill(1), sleep(1)

timeout should be compliant with the IEEE Std 1003.1-2024 (“POSIX.1”) specification.

A timeout utility appeared in SATAN, Netatalk, GNU Coreutils 7.0, OpenBSD 7.0, NetBSD 7.0, FreeBSD 10.3, IEEE Std 1003.1-2024 (“POSIX.1”).

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2024-07-22 Linux 6.6.67-gentoo-x86_64