2014-01-31 01:32:31 +04:00
|
|
|
# kill
|
|
|
|
|
2016-08-21 16:36:24 +03: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.
|
2014-01-31 01:32:31 +04:00
|
|
|
|
2016-08-21 16:36:24 +03:00
|
|
|
- Terminate a program using the default SIGTERM (terminate) signal:
|
2014-01-31 01:32:31 +04:00
|
|
|
|
|
|
|
`kill {{process_id}}`
|
|
|
|
|
2016-08-21 16:36:24 +03:00
|
|
|
- List available signal names (to be used without the `SIG` prefix):
|
2014-01-31 01:32:31 +04:00
|
|
|
|
2015-10-28 11:33:06 +03:00
|
|
|
`kill -l`
|
2016-08-21 16:36:24 +03:00
|
|
|
|
|
|
|
- Terminate a program using the SIGHUP (hang up) signal. Many daemons will reload instead of terminating:
|
|
|
|
|
|
|
|
`kill -{{1|HUP}} {{process_id}}`
|
|
|
|
|
|
|
|
- Terminate a program using the SIGINT (interrupt) signal. This is typically initiated by the user pressing `Ctrl+C`:
|
|
|
|
|
|
|
|
`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}}`
|
|
|
|
|
|
|
|
- Signal the operating system to pause a program, it until a SIGCONT ("continue") signal is received:
|
|
|
|
|
|
|
|
`kill -{{17|STOP}} {{process_id}}`
|