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 here
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

OptionWhat it does
PIDthe process number, from ps aux
-15SIGTERM: ask it to stop (the default)
-9SIGKILL: stop it now, no cleanup
-llist the signal names

Good to know

  • Try plain kill first: -9 can leave half-written files behind.
  • pkill NAME stops processes by name instead of PID.