KILLALL(1)

๐Ÿ“ฆ
version 23.7 ยท 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ KILLALL(1) โœจ

killall is the User Commands page for this one, bestie ๐ŸŽ€

๐Ÿ’– NAME

killall - kill processes by name ๐Ÿ”ช

๐Ÿงš SYNOPSIS

killall [-Z, --context pattern] [-e, --exact] [-g, --process-group] [-i, --interactive] [-n, --ns PID] [-o, --older-than TIME] [-q, --quiet] [-r, --regexp] [-s, --signal SIGNAL, -SIGNAL] [-u, --user user] [-v, --verbose] [-w, --wait] [-y, --younger-than TIME] [-I, --ignore-case] [-V, --version] [--] name ...
killall -l, --list
killall -V, --version

๐ŸŒธ DESCRIPTION

okay so killall sends a signal to all the processes running any of the commands you name ๐Ÿ’… If you don't pick a signal name, it sends SIGTERM by default. ngl that's the polite option ๐Ÿซถ

Signals can be picked by name (like -HUP or -SIGHUP), by number (like -1), or with the -s option ๐Ÿฆ‹

Here's the vibe: if the command name isn't a regular expression (that's -r) and it has a slash (/) in it, killall will go after any process running that particular file, no matter what it's named. Main character energy ๐Ÿ‘‘

killall returns a zero return code if at least one process got killed for each command you listed. It also returns zero if you didn't list any commands at all and at least one process matched your -u and -Z search criteria. Otherwise it returns non-zero. ๐Ÿ“‰

And the iconic part: a killall process never kills itself ๐Ÿ™ˆ (it can kill other killall processes though, so be careful lol)

๐ŸŽ€ OPTIONS

  • -e, --exact โ€” require an exact match for super long names ๐Ÿ’… If a command name is longer than 15 characters, the full name might be unavailable (aka it's been swapped out). In that case killall would kill everything matching the first 15 characters, but with -e those entries get skipped. If you add -v along with -e, killall prints a message for each skipped entry โœจ
  • -I, --ignore-case โ€” match process names without caring about upper or lower case ๐ŸŒˆ
  • -g, --process-group โ€” kill the whole process group the process belongs to. The signal only gets sent once per group, even if you find multiple processes from the same group ๐Ÿซง
  • -i, --interactive โ€” asks you for confirmation before killing anything. Protect your vibes ๐Ÿ›ก๏ธ
  • -l, --list โ€” list all the signal names it knows ๐Ÿ“œ
  • -n, --ns โ€” match against the PID namespace of the PID you give it. By default it matches against all namespaces ๐Ÿงฉ
  • -o, --older-than โ€” only match processes that are older (started before) the time you specify. The time is a float followed by a unit. The units are s, m, h, d, w, M, y for seconds, minutes, hours, days, weeks, months and years ๐Ÿ•ฐ๏ธ
  • -q, --quiet โ€” don't complain if no processes got killed ๐Ÿคซ
  • -r, --regexp โ€” treat the process name pattern as a POSIX extended regular expression, per regex(3) ๐Ÿ”
  • -s, --signal, -SIGNAL โ€” send this signal instead of SIGTERM ๐Ÿ”ฅ
  • -u, --user โ€” only kill processes owned by the user you specify. Command names are optional here ๐Ÿ‘ค
  • -v, --verbose โ€” tells you if the signal was successfully sent ๐Ÿ“ฃ
  • -V, --version โ€” shows version info ๐Ÿท๏ธ
  • -w, --wait โ€” waits for all the killed processes to die. killall checks once per second if any of them still exist, and only returns once none are left. Heads up: killall may wait forever if the signal was ignored, had no effect, or if the process is stuck in zombie state ๐Ÿ’€
  • -y, --younger-than โ€” only match processes that are younger (started after) the time you specify. The time is a float followed by a unit. The units are s, m, h, d, w, M, y for seconds, minutes, hours, days, weeks, months and years ๐ŸŒ™
  • -Z, --context โ€” specify a security context, and only kill processes whose security context matches the extended regular expression pattern you give. This one has to come before all your other arguments on the command line ๐Ÿ›ก๏ธ Command names are optional here too ๐Ÿฆ‹

๐Ÿ—‚๏ธ FILES

  • /proc โ€” the location of the proc file system ๐Ÿ“‚

๐Ÿ™ˆ KNOWN BUGS

Killing by file only works for executables that are kept open during execution. So impure executables can't be killed this way ๐Ÿ˜ญ
Be warned that typing killall name may not have the desired effect on non-Linux systems, especially when a privileged user does it ๐Ÿšจ

killall -w can't tell if a process disappears and gets replaced by a new process with the same PID between scans ๐Ÿ‘€

If processes change their name, killall may not be able to match them correctly ๐Ÿซ 

killall has a limit on how many names you can specify on the command line. That number is the size of an unsigned long integer multiplied by 8. For most 32 bit systems the limit is 32, and for a 64 bit system the limit is usually 64 ๐Ÿ”ข

๐Ÿ”— SEE ALSO

kill(1), fuser(1), pgrep(1), pidof(1), pkill(1), ps(1), kill(2), regex(3) ๐Ÿ’œ


that's the whole tea, bestie ๐Ÿซถ this page is from psmisc, dated 2023-06-17 โœจ go slay your terminal ๐Ÿ’…๐ŸŒˆ