1TIMEOUT(1) User Commands TIMEOUT(1)
2
3
4
6 timeout - run a command with a time limit
7
9 timeout [OPTION] DURATION COMMAND [ARG]...
10 timeout [OPTION]
11
13 Start COMMAND, and kill it if still running after DURATION.
14
15 Mandatory arguments to long options are mandatory for short options
16 too.
17
18 --preserve-status
19
20 exit with the same status as COMMAND, even when the
21
22 command times out
23
24 --foreground
25
26 when not running timeout directly from a shell prompt,
27
28 allow COMMAND to read from the TTY and get TTY signals; in this
29 mode, children of COMMAND will not be timed out
30
31 -k, --kill-after=DURATION
32
33 also send a KILL signal if COMMAND is still running
34
35 this long after the initial signal was sent
36
37 -s, --signal=SIGNAL
38
39 specify the signal to be sent on timeout;
40
41 SIGNAL may be a name like 'HUP' or a number; see 'kill -l' for a
42 list of signals
43
44 -v, --verbose
45 diagnose to stderr any signal sent upon timeout
46
47 --help display this help and exit
48
49 --version
50 output version information and exit
51
52 DURATION is a floating point number with an optional suffix: 's' for
53 seconds (the default), 'm' for minutes, 'h' for hours or 'd' for days.
54 A duration of 0 disables the associated timeout.
55
56 Upon timeout, send the TERM signal to COMMAND, if no other SIGNAL spec‐
57 ified. The TERM signal kills any process that does not block or catch
58 that signal. It may be necessary to use the KILL signal, since this
59 signal can't be caught.
60
61 EXIT status:
62 124 if COMMAND times out, and --preserve-status is not specified
63
64 125 if the timeout command itself fails
65
66 126 if COMMAND is found but cannot be invoked
67
68 127 if COMMAND cannot be found
69
70 137 if COMMAND (or timeout itself) is sent the KILL (9) signal
71 (128+9)
72
73 - the exit status of COMMAND otherwise
74
76 Some platforms don't currently support timeouts beyond the year 2038.
77
79 Written by Padraig Brady.
80
82 GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
83 Report any translation bugs to <https://translationproject.org/team/>
84
86 Copyright © 2022 Free Software Foundation, Inc. License GPLv3+: GNU
87 GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
88 This is free software: you are free to change and redistribute it.
89 There is NO WARRANTY, to the extent permitted by law.
90
92 kill(1)
93
94 Full documentation <https://www.gnu.org/software/coreutils/timeout>
95 or available locally via: info '(coreutils) timeout invocation'
96
97
98
99GNU coreutils 9.1 May 2023 TIMEOUT(1)