linux_wiki:kill

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
linux_wiki:kill [2014/11/24 22:29]
billdozor created
linux_wiki:kill [2019/05/25 23:50] (current)
Line 1: Line 1:
 ====== kill ====== ====== kill ======
 +
 +**General Information**
 +
 kill is the command to send signals to processes. kill is the command to send signals to processes.
  
-Some of the more often used singals:+**Checklist** 
 +  * Distro(s): Any 
 + 
 +---- 
 + 
 +====== Kill Signals ====== 
 + 
 +List kill signals 
 +<code bash> 
 +kill -l 
 +</code> 
 +\\ 
 + 
 +Some of the more often used signals:
  
 ^  Signal #  ^  Signal Name  ^  Description  ^  Can process ignore?  ^ ^  Signal #  ^  Signal Name  ^  Description  ^  Can process ignore?  ^
Line 9: Line 25:
 |  15  |  TERM  |  Software termination request, process cleans up and exits **(default)**  |  Yes  | |  15  |  TERM  |  Software termination request, process cleans up and exits **(default)**  |  Yes  |
  
-==== kill syntax ====+---- 
 + 
 +====== Kill Syntax ======
 <code bash> <code bash>
 kill [-signal] pid kill [-signal] pid
Line 19: Line 37:
 If -signal is ommited, kill sends -15 (TERM) by default. If -signal is ommited, kill sends -15 (TERM) by default.
  
-==== 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 41: Line 61:
 kill -9 2123 kill -9 2123
 </code> </code>
 +
 +----
 +
 +====== pkill ======
 +
 +Kill process by name (instead of PID)
 +<code bash>
 +pkill httpd
 +</code>
 +  * 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
 +</code>
 +
 +\\
 +Kill all processes started from a specific terminal
 +<code bash>
 +pkill -t pts/1
 +</code>
 +  * This does NOT kick them off the system, only kills their running programs started from that session.
 +
 +----
 +
  • linux_wiki/kill.1416886150.txt.gz
  • Last modified: 2019/05/25 23:50
  • (external edit)