Skip to main content

kill Cheatsheet

By Dejan Panovski Updated on Download PDF

Quick reference for sending signals to processes by PID with kill and killall in Linux

The `kill` command sends signals to processes by PID. Use it to stop, reload, or pause a process. This cheatsheet covers common signals, kill by PID, `killall` by name, background job control, and a full signal reference.

Basic Syntax

Core kill command forms.

CommandDescription
kill PIDSend SIGTERM (graceful stop) to a process
kill -9 PIDForce kill a process (SIGKILL)
kill -1 PIDReload process config (SIGHUP)
kill -lList all available signal names and numbers
kill -0 PIDCheck if a PID exists without sending a signal

Signal Reference

Signals most commonly used with kill, killall, and pkill.

SignalNumberDescription
SIGHUP1Reload config — most daemons reload settings without restarting
SIGINT2Interrupt process — equivalent to pressing Ctrl+C
SIGQUIT3Quit and write a core dump for debugging
SIGKILL9Force kill — cannot be caught or ignored; always terminates immediately
SIGTERM15Graceful stop — default signal; process can clean up before exiting
SIGUSR110User-defined signal 1 — meaning depends on the application
SIGUSR212User-defined signal 2 — meaning depends on the application
SIGCONT18Resume a process that was suspended with SIGSTOP
SIGSTOP19Suspend process — cannot be caught or ignored
SIGTSTP20Terminal stop — equivalent to pressing Ctrl+Z

Kill by PID

Send signals to one or more specific processes.

CommandDescription
kill 1234Gracefully stop PID 1234
kill -9 1234 5678Force kill multiple PIDs at once
kill -HUP 1234Reload config for PID 1234
kill -STOP 1234Suspend PID 1234
kill -CONT 1234Resume suspended PID 1234
kill -9 $(pidof firefox)Force kill all PIDs for a process by name

killall: Kill by Name

Send signals to all processes matching an exact name.

CommandDescription
killall process_nameSend SIGTERM to all matching processes
killall -9 process_nameForce kill all matching processes
killall -HUP nginxReload all nginx processes
killall -u username process_nameKill matching processes owned by a user
killall -v process_nameKill and report which processes were signaled
killall -r "pattern"Match process names with a regex pattern

Background Jobs

Kill jobs running in the current shell session.

CommandDescription
jobsList background jobs and their job numbers
kill %1Send SIGTERM to background job number 1
kill -9 %1Force kill background job number 1
kill %+Kill the most recently started background job
kill %%Kill the current (most recent) background job

Troubleshooting

Quick fixes for common kill issues.

IssueCheck
Process does not stop after SIGTERMWait a moment, then escalate to kill -9 PID
No such process errorPID has already exited; verify with ps -p PID
Operation not permittedProcess belongs to another user — use sudo kill PID
SIGKILL has no effectProcess is in uninterruptible sleep (D state in ps); only a reboot can free it
Not sure which PID to killFind it first with pidof name, pgrep name, or ps aux | grep name
GuideDescription
kill Command in LinuxFull guide to kill options, signals, and examples
How to Kill a Process in LinuxPractical walkthrough for finding and stopping processes
pkill Command in LinuxKill processes by name and pattern
pgrep Command in LinuxFind process PIDs before signaling
ps Command in LinuxInspect the running process list