Back to the command reference

kill

ProcessesFundamentals In simulator In real Linux

Send a signal to a process (terminate by default)

Name: kill

You can practise it right away in the simulator, and use it in real Linux mode too.

Description

kill sends a signal to a process by PID. The default, SIGTERM (15), asks it to exit and lets it clean up; SIGKILL (9) is enforced by the kernel and cannot be ignored or cleaned up after, so use it as a last resort.

Ordinary users may signal only their own processes. bash's builtin kill also accepts job numbers like %1.

Syntax

kill [-SIGNAL] PID...

Common options

-15SIGTERM: ask to terminate (default)
-9SIGKILL: force kill; cannot be ignored
-s SIGNALName the signal, e.g. kill -s HUP 1234 (reload a service)
-lList signal names
%NSignal job N (the number from jobs)

Examples

Related