Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
linux_wiki:kill [2016/03/18 23:22] billdozor [kill] |
linux_wiki:kill [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 10: | Line 10: | ||
---- | ---- | ||
- | ===== Kill Signals ===== | + | ====== Kill Signals ====== |
+ | |||
+ | List kill signals | ||
+ | <code bash> | ||
+ | kill -l | ||
+ | </ | ||
+ | \\ | ||
Some of the more often used signals: | Some of the more often used signals: | ||
Line 21: | Line 27: | ||
---- | ---- | ||
- | ===== Kill Syntax ===== | + | ====== Kill Syntax |
<code bash> | <code bash> | ||
kill [-signal] pid | kill [-signal] pid | ||
Line 33: | Line 39: | ||
---- | ---- | ||
- | ===== Kill Examples ===== | + | ====== Kill Examples |
Ask apache to re-read its configuration file after changes have been made. (Assumes httpd is pid 2123) | Ask apache to re-read its configuration file after changes have been made. (Assumes httpd is pid 2123) | ||
Line 55: | Line 61: | ||
kill -9 2123 | kill -9 2123 | ||
</ | </ | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ====== pkill ====== | ||
+ | |||
+ | Kill process by name (instead of PID) | ||
+ | <code bash> | ||
+ | pkill httpd | ||
+ | </ | ||
+ | * Kills all process ids named httpd, sending signal 15 (SIGTERM) | ||
+ | |||
+ | \\ | ||
+ | Remove a user's ssh session (kick user off system) | ||
+ | <code bash> | ||
+ | pkill -u rjones sshd | ||
+ | </ | ||
+ | |||
+ | \\ | ||
+ | Kill all processes started from a specific terminal | ||
+ | <code bash> | ||
+ | pkill -t pts/1 | ||
+ | </ | ||
+ | * This does NOT kick them off the system, only kills their running programs started from that session. | ||
+ | |||
+ | ---- | ||
+ |