kill
Stop a stuck program by its PID: the polite way first, kill -9 when it won't listen.
>_ Try it: a simulated Linux, right herenothing runs on your computer
Loading the terminal…
Examples
-
kill 4242 -
kill 5150 -
ps aux | grep frozen -
kill -9 5150 -
kill -l
How it works
Every running program is a process with a number, its PID. ps aux lists them; kill PID asks one to stop.
By default kill sends SIGTERM, a polite "please finish": the program can clean up. A frozen one may ignore it; kill -9 (SIGKILL) stops it at once, with no chance to save anything.
Syntax
kill [-SIGNAL] PID...
Options
| Option | What it does |
|---|---|
PID | the process number, from ps aux |
-15 | SIGTERM: ask it to stop (the default) |
-9 | SIGKILL: stop it now, no cleanup |
-l | list the signal names |
Good to know
- Try plain
killfirst:-9can leave half-written files behind. pkill NAMEstops processes by name instead of PID.