Table of Contents

Name

tkill -- kill a process if it has been running for too long

Synopsis

tkill [-Phl] [-t timeout] [-s signal] (pid ... | -C cmd | -c cmd)

Desription

The tkill utility kills a given process or process group if it has been running for longer than the specified time.

The following options are supported:

-C cmd
Kill processes by name, not by process ID. If the given command is found to be a substring of any command in the process table, then those processes are killed.

-P
Kill all processes whose parent is the given pid.

-c cmd
Kill processes by name, not by process ID. The given command must match exactly the command in the process table.

-h
Print a usage statement and exit.

-l
Print a list of valid signals and exit.

-t timeout
Specify the timeout in seconds. If not specified, default to 300.

-s signal
Kill with the given signal, which may be either numeric or the symbolic name of hte signal. If not specified, kill with the TERM signal.

Examples

The following examples illustrate common usage of this tool.

To kill the processes with the process IDs 1234 1235 and 1236 if they have been running for longer than 500 seconds:

tkill 1234 1235 1236

To kill all the children of process ID 1234 if they have been running for longer than one hour:

tkill -t 3600 -P 1234

See Also

kill(1)

History

The tkill utility was originally written by Jan Schaumann <jschauma@yahoo-inc.com> in July 2007.

Bugs

Please submit bug reports and feature requests to the author.


Table of Contents