Filters
How to search
  • Plain words find names, texts and examples.
  • "two words" finds the exact phrase.
  • --name or -x finds an option.
  • #word looks only inside commands.
  • @grep finds lessons and labs that use grep.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Put ! before a word to leave it out. OR between words means one of them.
  • ↑ ↓ to move · Enter to open · Esc to close · / to search

killall

Send a signal to all processes with a given name.

Level
Everyday Linux
Group
Processes and jobs
Needs root
For changes
Package
psmisc

What it does

killall NAME sends SIGTERM to every process with exactly that command name. It is handy when a program has many processes. Options select by user, age or a regular expression, and -i asks before each one.

How to write it

killall [OPTION]... [-s SIGNAL | -SIGNAL] NAME...
killall -l

Options 16

Most used

-s, --signal SIGNAL, -SIGNAL
The signal to send (default TERM).
-u, --user USER
Only processes of this user.
-i, --interactive
Ask before each process.
-e, --exact
Exact match for long names (over 15 characters).
-I, --ignore-case
Ignore upper and lower case.
-r, --regexp
NAME is an extended regular expression.
-o, --older-than TIME
Only processes older than TIME (like 30m, 2h).
-y, --younger-than TIME
Only processes younger than TIME.
-w, --wait
Wait until the processes are gone.
-g, --process-group
Signal the process group.
-q, --quiet
No message if nothing was killed.
-v, --verbose
Report each signal.
-n, --ns PID
Only processes in the same PID namespace as PID.
-Z, --context PATTERN
Only processes with this SELinux context.
-l, --list
List the signal names.
-V, --version
Show the version.

Examples 10

$ run as a normal user# run as root (or with sudo)

  1. 1Stop all processes with a name

    killall dd

    Every dd of yours.

  2. 2Force

    killall -9 stuck-app

    When SIGTERM did not help.

  3. 3Only one user's processes

    killall -u lisa firefox

    Other users' firefox keeps running.

  4. 4Ask for each one

    killall -i bash
    Kill bash(4301) ? (y/N)

    Safe when you are not sure.

  5. 5Wait until they are gone

    killall -w myapp && systemctl start myapp

    No race between stop and start.

  6. 6Old processes only

    killall -o 2h find

    Stops find jobs that run more than 2 hours.

  7. 7With a regular expression

    killall -r '^python3\.1[0-9]$'

    Matches python3.10 … python3.19.

  8. 8Reload many processes

    killall -HUP rsyslogd

    Same as a reload.

  9. 9Quiet in scripts

    killall -q sleep || true

    No message when none run.

  10. 10Verbose report

    killall -v dd
    Killed dd(4123) with signal 15

    Shows what happened.

Watch out

  • On some other UNIX systems killall kills all processes. Use it only on Linux.
  • Names are cut to 15 characters; use -e for long names.

Exit codes

0 :: At least one process got the signal. 1 :: No process was killed.