TIMEOUT(1) | General Commands Manual | TIMEOUT(1) |
timeout
— run 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 string containing non-negative decimal numbers including floats, terminated by a suffix: s for seconds, m for minutes, h for hours, d for days. If the final number doesn't have a suffix it is assumed to be seconds. Longer durations are taken as out of scope.
-f
-k
durationSIGKILL
after
duration.-p
-s
SIGNALSIGTERM
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:
timeout
Otherwise, the exit status of command is returned.
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>
June 18, 2025 | Linux |