2014-01-30 22:32:31 +01:00
|
|
|
# kill
|
|
|
|
|
2016-08-21 14:36:24 +01:00
|
|
|
> Sends a signal to a process, usually related to stopping the process.
|
|
|
|
> All signals except for SIGKILL and SIGSTOP can be intercepted by the process to perform a clean exit.
|
2024-01-09 05:50:21 -03:00
|
|
|
> More information: <https://manned.org/kill.1posix>.
|
2014-01-30 22:32:31 +01:00
|
|
|
|
2016-08-21 14:36:24 +01:00
|
|
|
- Terminate a program using the default SIGTERM (terminate) signal:
|
2014-01-30 22:32:31 +01:00
|
|
|
|
|
|
|
`kill {{process_id}}`
|
|
|
|
|
2016-08-21 14:36:24 +01:00
|
|
|
- List available signal names (to be used without the `SIG` prefix):
|
2014-01-30 22:32:31 +01:00
|
|
|
|
2015-10-28 14:03:06 +05:30
|
|
|
`kill -l`
|
2016-08-21 14:36:24 +01:00
|
|
|
|
|
|
|
- Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
|
|
|
|
|
|
|
|
`kill -{{1|HUP}} {{process_id}}`
|
|
|
|
|
2025-03-09 03:23:24 +02:00
|
|
|
- Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `<Ctrl c>`:
|
2016-08-21 14:36:24 +01:00
|
|
|
|
|
|
|
`kill -{{2|INT}} {{process_id}}`
|
|
|
|
|
|
|
|
- Signal the operating system to immediately terminate a program (which gets no chance to capture the signal):
|
|
|
|
|
|
|
|
`kill -{{9|KILL}} {{process_id}}`
|
|
|
|
|
2019-01-08 23:46:54 +01:00
|
|
|
- Signal the operating system to pause a program until a SIGCONT ("continue") signal is received:
|
2016-08-21 14:36:24 +01:00
|
|
|
|
|
|
|
`kill -{{17|STOP}} {{process_id}}`
|
2019-01-08 23:48:21 +01:00
|
|
|
|
2019-01-09 00:12:18 +01:00
|
|
|
- Send a `SIGUSR1` signal to all processes with the given GID (group id):
|
2019-01-08 23:48:21 +01:00
|
|
|
|
2019-01-09 00:12:18 +01:00
|
|
|
`kill -{{SIGUSR1}} -{{group_id}}`
|