Linux kill command

Updated: 04/26/2017 by Computer Hope

About kill

kill is used to send a signal to a process.

kill syntax

kill [-s] [-l] %pid


The default signal for kill is TERM (which will terminate or "kill" the process). Use -l or -L to list available signals. Particularly useful signals include HUP, INT, KILL, STOP, CONT, and 0. Alternate signals may be specified in three ways: -9, -SIGKILL or -KILL. Negative PID (process ID) values may be used to choose whole process groups; see the PGID column in the output of the ps command. A PID of -1 is special; it indicates all processes except two: the kill process itself, and init.

pid [...] Send a signal to every pid listed.
-s signal,
--signal signal
Specify the signal to be sent. The signal can be specified by using name or number. The behavior of signals, and their identifying names, are listed on our signals page.
-l, --list [signal] List signal names. This option has optional argument, which will convert signal number to signal name, or other way around.
-L, --table List signal names in a nice table.

kill examples

kill -9 -1

Kills all processes possible to be killed.

kill -l 11

Translates signal number 11 into its signal name.

kill -L

Lists the available signal choices in a tabular format.

kill 123 543 2341 3453

Sends the default signal (TERM) to the processes with IDs 123, 543, 2341, and 3453, terminating those processes.

bg — Resume a suspended program without bringing it to the foreground.
csh — The C shell command interpreter.
fg — Resumes a suspended job and brings it to the foreground.
fuser — Identify processes using files or sockets.
init — The parent of all processes on the system.
jobs — List the status of all running jobs.
killall — Kill processes by name.
ksh — The Korn shell command interpreter.
ps — Report the status of a process or processes.