Linux for Developers
/Beginner
kill
Definition
A command used to send a signal to a process, usually to terminate it. It requires the precise Process ID (PID).
Explain Like I'm New
The sniper rifle. You give it the exact ID number of a misbehaving app, and it shoots it down.
Real World Example
A Node app crashes and leaves a ghost process holding Port 3000 open. You find the PID is 405. You type `kill 405`. The OS politely asks the process to shut down.
Common Use Cases
- •Terminating frozen applications
- •Freeing up locked network ports
Crucial Command Flags
| Flag / Option | Description |
|---|---|
| -9 | SIGKILL. Forcefully kill the process immediately. |
| -15 | SIGTERM. Gracefully ask the process to terminate (default). |
| -l | List all available signal names. |
Interview Questions
basic
- If a process refuses to close when you use the `kill` command, what flag do you add to forcefully murder it?
intermediate
- Does the `kill` command actually 'kill' things, or does it do something else?