Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
TIMEOUT(1)		FreeBSD	General	Commands Manual		    TIMEOUT(1)

NAME
     timeout --	run a command with a time limit

SYNOPSIS
     timeout [--signal sig | -s	sig] [--preserve-status]
	     [--kill-after time	| -k time] [--foreground] duration command
	     [args ...]

DESCRIPTION
     timeout starts the	command	with its args.	If the command is still	run-
     ning after	duration, it is	killed.	 By default, SIGTERM is	sent.  The
     special duration, zero, signifies no limit.  Therefore a signal is	never
     sent if duration is 0.

     The options are as	follows:

     --preserve-status
	     Exit with the same	status as command, even	if it times out	and is
	     killed.

     --foreground
	     Do	not propagate timeout to the children of command.

     -s	sig, --signal sig
	     Specify the signal	to send	on timeout.  By	default, SIGTERM is
	     sent.

     -k	time, --kill-after time
	     Send a SIGKILL signal if command is still running after time
	     after the first signal was	sent.

DURATION FORMAT
     duration and time are non-negative	integer	or real	(decimal) numbers,
     with an optional unit-specifying suffix.  Values without an explicit unit
     are interpreted as	seconds.

     Supported unit symbols are:
     s	     seconds
     m	     minutes
     h	     hours
     d	     days

EXIT STATUS
     If	the timeout was	not reached, the exit status of	command	is returned.

     If	the timeout was	reached	and --preserve-status is set, the exit status
     of	command	is returned.  If --preserve-status is not set, an exit status
     of	124 is returned.

     If	command	exits after receiving a	signal,	the exit status	returned is
     the signal	number plus 128.

     If	command	refers to a non-existing program, the exit status returned is
     127.

     If	command	is an otherwise	invalid	program, the exit status returned is
     126.

     If	an invalid parameter is	passed to -s or	-k, the	exit status returned
     is	125.

SEE ALSO
     kill(1), signal(3)

HISTORY
     The timeout command first appeared	in FreeBSD 10.3.

AUTHORS
     Baptiste Daroussin	<bapt@FreeBSD.org> and
     Vsevolod Stakhov <vsevolod@FreeBSD.org>

FreeBSD	Ports 11.2		March 28, 2018		    FreeBSD Ports 11.2

NAME | SYNOPSIS | DESCRIPTION | DURATION FORMAT | EXIT STATUS | SEE ALSO | HISTORY | AUTHORS

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=timeout&sektion=1&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help