Privacy Policy
© 2025 linux101.dev

kill, pkill & killall Cheatsheet

These commands are used to send signals to processes, typically to terminate them. The primary difference between them lies in how they identify the target process(es).

Understanding Signals

A signal is a way for the operating system to interrupt a process and tell it to perform an action. You can specify a signal by name (e.g., `TERM`) or number (e.g., `15`).

SignalNumberDescription
TERM15**Graceful shutdown.** Asks the process to terminate gracefully, giving it time to clean up resources. This is the default signal for the kill command.
KILL9**Forceful shutdown.** Terminates the process immediately and unconditionally. It cannot be caught, blocked, or ignored by the process. Use this as a last resort.
HUP1**Hang up.** Often used to tell a process (like a daemon) to reload its configuration without shutting down.

Command Reference

CommandDescriptionExample
killSends a signal to a process identified by its **PID** (Process ID). It is the most precise way to terminate a single process.kill 12345
kill -9 12345
pkillSends a signal to processes based on a **partial or full name**. It is a convenient way to kill processes without knowing their PIDs.pkill firefox
pkill -TERM sshd
killallSends a signal to all processes with an **exact name**. Use with caution as it can terminate multiple processes with the same name.killall nginx
killall -HUP httpd