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 -lOptions 16
Most used
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1Stop all processes with a name
killall ddEvery dd of yours.
2Force
killall -9 stuck-appWhen SIGTERM did not help.
3Only one user's processes
killall -u lisa firefoxOther users' firefox keeps running.
4Ask for each one
killall -i bash Kill bash(4301) ? (y/N)Safe when you are not sure.
5Wait until they are gone
killall -w myapp && systemctl start myappNo race between stop and start.
6Old processes only
killall -o 2h findStops find jobs that run more than 2 hours.
7With a regular expression
killall -r '^python3\.1[0-9]$'Matches python3.10 … python3.19.
8Reload many processes
killall -HUP rsyslogdSame as a reload.
9Quiet in scripts
killall -q sleep || trueNo message when none run.
10Verbose report
killall -v dd Killed dd(4123) with signal 15Shows what happened.
Nothing matches this filter.
Watch out
- On some other UNIX systems
killallkills 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.