UnixDroid

Processes · Linux command

kill command in Linux

What does kill do?

kill sends a signal to a process by its PID — by default asking it to stop (SIGTERM). kill -9 forces it to stop immediately.

kill [-signal] PID

Most useful options

OptionWhat it does
-15polite stop (default)
-9force kill, cannot be ignored
-llist signals

kill examples

$ kill 1234 Try it ›

stop process 1234

$ kill -9 1234 Try it ›

force it

$ pkill nginx Try it ›

stop by name

In security work

Kill a malicious process only after collecting evidence (ps, ls -l /proc/PID/exe), or you lose it.

Questions about kill

What is the difference between kill and kill -9?

kill asks politely so the program can clean up; kill -9 stops it instantly with no clean-up.