kill
Quick Reference
Command Name:
kill
Category:
process management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Process termination
Send signals to terminate processes
- 2
Resource management
Manage system resources by terminating processes
- 3
Scripting
Use in shell scripts to terminate processes programmatically
- 4
Troubleshooting
Resolve issues with unresponsive or misbehaving processes
Syntax
kill [options] PID...
Options
Option | Description |
---|---|
-s, --signal SIGNAL | Specify the signal to send (by name or number) |
SIGNAL | Signal number or name (can be specified without -s, e.g., kill -9 PID) |
-l, --list [SIGNAL] | List signal names, or convert a signal number to a name |
-L, --table | List signal names and numbers in a table |
-h, --help | Display help message and exit |
-v, --version | Output version information and exit |
Examples
How to Use These Examples
The examples below show common ways to use the kill
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Usage:
kill 1234
Send the default TERM signal to process with PID 1234.
kill -9 1234
Send the KILL signal (9) to forcefully terminate a process with PID 1234.
kill -SIGTERM 1234
Send the TERM signal using the signal name instead of number.
Multiple Processes:
kill 1234 5678 9012
Send the default TERM signal to multiple processes at once.
kill -15 $(pgrep firefox)
Send the TERM signal (15) to all processes with "firefox" in their name.
Signal Types:
kill -l
List all available signal names and numbers.