System and processes

The kill command

Sends a signal to a process to ask it to finish, pause it or resume it. It is how you tell a program to stop.

Syntax

kill [-SEÑAL] PID... | kill -l

Most useful options

-lLists every signal with its number and name
-15 (SIGTERM)Default signal: asks to finish cleanly
-9 (SIGKILL)Kills with no chance to save: last resort
-STOP / -CONTPauses the process or resumes it

Copy-ready examples

$ sleep 100 &Launch a background job
$ sleep 100 & && kill %1Kill job 1 by its number
$ sleep 100 & && kill -STOP %1 && bg %1Pause it and resume it
$ kill -lSee the available signals

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • By default it sends SIGTERM (15): it asks to finish, it does not force. Save your work before using -9.
  • A PID is not a job number: for a job use %N (kill %1).
  • You cannot kill process 1 (init/systemd) or your own shell.

Related commands

FAQ

Why does a process not die with kill?

Because SIGTERM is only a request: if the program ignores it, use kill -9 PID.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course