LinuxCommandLibrary

killall

Kill processes by name

TLDR

Terminate a process using the default SIGTERM (terminate) signal

$ killall [process_name]
copy

List available signal names (to be used without the SIG prefix)
$ killall [[-l|--list]]
copy

Interactively ask for confirmation before termination
$ killall [[-i|--interactive]] [process_name]
copy

Terminate a process using the SIGINT (interrupt) signal, which is the same signal sent by pressing
$ killall -INT [process_name]
copy

Force kill a process
$ killall -KILL [process_name]
copy

SYNOPSIS

killall [options] [--] name ...
killall [options] -l
killall [options] --table

PARAMETERS

-a, --all
    Ignore effective UID; kill processes of any user.

-e, --exact
    Require exact name match (for long names).

-g, --group name|gid
    Match processes in specific process group.

-i, --interactive
    Prompt before killing each process.

-I, --ignore-case
    Case-insensitive name matching.

-l, --list
    List all known signal names.

-n, --newest
    Kill only the newest matching process.

-o, --oldest
    Kill only the oldest matching process.

-q, --quiet
    Suppress non-error messages.

-r, --regexp
    Treat name as extended regex.

-s, --signal SIGNAL
    Send specific signal (name or number).

-t, --table
    Print table of matching PIDs and names.

-u, --user user|uid
    Target processes owned by specific user.

-v, --verbose
    Report successful signal delivery.

-w, --wait
    Wait for all processes to terminate.

-y, --youngest
    Kill only the youngest matching process.

--help
    Display help message.

--version
    Print version information.

DESCRIPTION

The killall command sends signals to all processes with a matching name, making it easy to terminate programs without knowing PIDs. It matches the basename of the executable from /proc/[pid]/comm (truncated to 16 characters in most kernels). By default, it sends SIGTERM (signal 15), allowing graceful shutdown. Specify other signals like SIGKILL (-9 or -KILL) for forceful termination.

Ideal for scripts or killing multiple instances (e.g., all firefox processes), but requires caution. Names are case-sensitive by default; use -I for insensitive matching. Options refine targeting: by user (-u ), interactively (-i), oldest/newest (-o/-n), or regex (-r). Verbose (-v) reports actions; -w waits for death.

Part of procps-ng, it underpins tools like pkill. Unlike kill, it targets names, not PIDs, but risks unintended kills if names collide across services.

CAVEATS

Extremely dangerous on multi-user systems: kills all matching processes regardless of owner unless -u used. Names can collide (e.g., multiple daemons). /proc/[pid]/comm truncates to 16 chars. Cannot kill PID 1 (init/systemd). -w may hang if processes ignore signals. Use -i for safety.

SIGNAL SPECIFICATION

Default: SIGTERM (15). Use names (HUP, INT, KILL) or numbers (1-64). Prefix with - (e.g., killall -9) or -s 9.

EXAMPLES

killall firefox
Sends SIGTERM to all Firefox.

killall -9 -u user httpd
Forcibly kills user's HTTP servers.

killall -i emacs
Prompts before killing Emacs instances.

HISTORY

Introduced in procps 1.01 (1993) by Brendan O'Dea and others for easy process termination. Evolved in procps suite; procps-ng fork (2010+) by Craig Small added options like -I, -g, age targeting. Widely used in Linux distros for scripts and admin tasks.

SEE ALSO

pkill(1), pgrep(1), kill(1), pidof(1), ps(1)

Copied to clipboard