OpenBSD manual page server

Manual Page Search Parameters

TIMEOUT(1) General Commands Manual TIMEOUT(1)

timeoutrun a command with a time limit

timeout [-fp] [-k time] [-s signal] duration command [arg ...]

The timeout utility executes command and kills it if it is still running after the specified duration. If duration is 0, the timeout is disabled.

The options are as follows:

, --foreground
Do not propagate the timeout signal to children processes.
time, --kill-after=time
Send a second signal, SIGKILL, if the command is still running time after the first signal was sent.
, --preserve-status
Always exit with the same status as command, even if the timeout was reached.
signal, --signal=signal
A non-negative decimal number or symbolic signal name specifying the signal to send on timeout, instead of the default SIGTERM.

duration and time may contain a decimal fraction. The value defaults to seconds unless a unit suffix is given.

The supported unit suffixes are:

s
seconds
m
minutes
h
hours
d
days

The timeout utility may return one of the following statuses:

124
The time limit expired and the -p flag was not set.
126
The command was found but could not be executed.
127
The command was not found.

Otherwise, timeout returns the exit status of the command.

kill(1), signal(3)

The timeout utility is compliant with the specification.

The timeout utility first appeared in GNU Coreutils 7.0 and has been available since OpenBSD 7.0.

June 16, 2024 OpenBSD-current