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 [2015/03/09 22:56] billdozor |
linux_wiki:kill [2019/05/25 23:50] (current) |
||
---|---|---|---|
Line 6: | Line 6: | ||
**Checklist** | **Checklist** | ||
- | * Distros: All | + | * Distro(s): Any |
---- | ---- | ||
- | ===== Kill Signals ===== | + | ====== Kill Signals |
- | Some of the more often used singals: | + | List kill signals |
+ | <code bash> | ||
+ | kill -l | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | Some of the more often used signals: | ||
^ Signal # ^ Signal Name ^ Description | ^ Signal # ^ Signal Name ^ Description | ||
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. | ||
+ | |||
+ | ---- | ||
+ |