-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkill.txt
34 lines (26 loc) · 1.03 KB
/
kill.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# politely ask process to stop
$ kill 1234
# shoot process in the head
$ kill -9 1234
Usage:
kill [-<signal>] <pid>
kill -l [name/number]
# kill is used to send signals to running processes (by pid)
# By default it sends SIGTERM (15) which politely asks the process to stop.
# Signal 9 or SIGKILL (or KILL) halts the process impolitely.
# Specified signals follow a '-'. A signal can be the name, short name or number.
# To suspend and then continue a process (to eg temporarily halt a running cronjob),
# use 19 (SIGSTOP) and 18 (SIGCONT):
# Suspend ...
$ kill -19 12345
# ... and continue.
$ kill -18 12345
# Suspending a parent process will _not_ suspend it's children!
# `pstree -p` can be useful to find the exact PID to use.
# these all do the same:
kill -15 123, kill -SIGTERM 123, kill -TERM 123
# list signals (supply a number to get signal name, or vice versa)
$ kill -l [number/name]
# tip: partial PIDs can be tab-completed (on sane systems, anyway)
See also: $ man 7 signal
https://en.wikipedia.org/wiki/Signal_(IPC)