Skip to content

kill command

Send a signal to a process, usually to stop it.

On this page

Syntax

kill [-signal] PID…pkill [options] patternkillall [options] name

Provided by the procps, psmisc package. Run man kill for the full manual.

Common options

OptionWhat it does
-15 / -TERMAsk the process to exit (default)
-9 / -KILLForce it to stop immediately
-1 / -HUPHang up; many daemons reload config
-lList signal names
pkill -fMatch the full command line
pkill -u USEROnly that user's processes

Examples

  1. Stop a process by PID

    kill 1234
  2. Force-kill a process

    kill -9 1234
  3. Stop processes by name

    pkill nginx
  4. Match the full command line

    pkill -f "python app.py"
  5. Kill every process with a name

    killall node
  6. Kill whatever is using port 8080

    kill $(lsof -t -i:8080)
  7. Reload a daemon

    sudo kill -HUP $(pidof nginx)
  8. List signals

    kill -l

Tips

  • Try a normal kill first; -9 gives the process no chance to clean up.

kill guides

← All Linux commands · Suggest a fix

Back to top