Shell, system, and network tools
Linux commands: killall
Learn how the Linux killall command sends a signal to every process with a name, so killall top ends all running top instances, and how to set the signal.
8 minute lesson
kill targets process IDs. killall targets every matching process name, so its scope is wider:
This is the syntax:
killall <name>
Before sending anything, inspect what will match:
pgrep -a top
Then ask the processes to terminate normally:
killall -TERM top
TERM gives a program a chance to flush data and clean up. Wait and inspect again. Use KILL only when the process cannot respond, because it cannot run cleanup handlers:
killall -KILL top
Signals can mean program-specific actions. HUP often asks a daemon to reload configuration, but that behavior belongs to the program, not to killall:
killall -HUP top
Process-name matching and available flags vary between Linux and macOS. Read the local manual with man killall; never assume a command copied from another operating system has identical semantics.
For one known process, prefer its PID or service manager because the target is explicit. killall can terminate your own unrelated sessions with the same name, and elevated privileges widen the damage.
Try it: start two harmless sleep 60 processes, inspect them with pgrep, send TERM by name, and confirm both exited.
Lesson completed