How to Kill Processes by Name with the Linux killall Command
The killall command sends a signal to every process with a matching name. killall firefox stops all Firefox instances at once. It complements kill, which needs the exact PID.
Stop all instances of a program
Give killall the program name and it signals every matching process. This is the fastest way to stop an app with multiple windows or workers.
Force kill with -9
If a program ignores the normal request, send SIGKILL:
Confirm with -i
Add -i to be asked before each process is killed. Handy when you are about to kill several instances.
The name-matching warning
killall matches by process name, which can hit unintended programs with similar names. Check what would match first with pgrep -a name, or match the exact name with -e.
killall vs kill vs pkill
kill targets a PID, killall targets a name, and pkill matches patterns. See killall and the kill guide for all signals.
Keep learning
Related guides: How to Kill a Process in Linux with the kill Command · How to Monitor Processes with ps and top · How to Run Commands as Root with sudo. Read all tutorials on the Learn Linux blog.