killall Command: Kill Processes by Name, the -9 Signal, and Installing psmisc

Test environmentRHEL familyAlmaLinux 9.8psmisc 23.4root accountDebian 12 · psmisc 23.6 Regular account (runs killall)
Process · job scheduling commandskillallLocation/usr/bin/killallChecked 2026-11-03

The killall command is a Linux command that picks running processes by program name instead of process number (PID) and sends them a signal; if you don't specify a signal, it sends SIGTERM (per the official manual). Because it ends every process with the same name at once, we first checked with pgrep and ps four processes started on an AlmaLinux 9 server from copies of sleep under different names, and for an executable longer than 15 characters, only the first 15 characters remained in the process name.

We ran killall only on xxsleep processes started for testing under a regular account on a Debian 12 server. The result boxes show rpm, pgrep, ps, pidof, cat, and kill output run as root on an AlmaLinux 9.8 server, and killall output run on the Debian 12 server. Process numbers (PIDs), process names, executable paths, and account names have been replaced with example values.

1️⃣ Installing the killall command

  • ↪️ The psmisc package and checking the version

killall is part of the psmisc package. On an AlmaLinux 9.8 server, checking with rpm which package /usr/bin/killall belongs to showed version psmisc 23.4.

rpm -qf --qf '%{NAME} %{VERSION}\n' /usr/bin/killall
psmisc 23.4

The file list of the same package, viewed with rpm -ql, also included pstree and fuser.

If you get [command not found], meaning the command can't be found, install the psmisc package. On the RHEL family it's [dnf install psmisc], and on the Debian family it's [apt install psmisc]. The Debian 12 server already had psmisc 23.6 installed, and killall was at /usr/bin/killall.

Checking on the AlmaLinux 9.8 server, the similarly named pkill was in the procps-ng package, and kill was a shell built-in command.

2️⃣ How to use the killall command

  • ↪️ Checking targets by process name

The basic form is [killall process name]. It finds every running process with the given name and sends it a signal; if you give several names, it does the same for each name (per the official manual).

Because processes with the same name all end at once, first check with pgrep what is running under that name. We copied sleep into a working folder under the names xxsleep-a1, xxsleep-a2, and xxsleep-longname-x1, started xxsleep-a1 twice for four processes in total, and printed numbers and names with -l.

pgrep -l xxsleep
2141 xxsleep-a1
2142 xxsleep-a1
2150 xxsleep-a2
2155 xxsleep-longnam

The fourth line's executable is named xxsleep-longname-x1, but the process name was cut off at xxsleep-longnam.

Adding -a shows the whole command line that was run. The two xxsleep-a1 processes with the same name were told apart by the trailing seconds argument, 300 and 310.

pgrep -a xxsleep
2141 /root/work/xxsleep-a1 300
2142 /root/work/xxsleep-a1 310
2150 /root/work/xxsleep-a2 320
2155 /root/work/xxsleep-longname-x1 330

To find only processes whose name matches exactly, add -x. The result for xxsleep-a1 was two numbers.

pgrep -x xxsleep-a1
2141
2142

To check only the numbers by entering one name as is, use pidof. Searching for xxsleep-a1 printed both numbers on one line.

pidof xxsleep-a1
2142 2141

ps prints only processes whose name matches exactly when you list several names after -C, separated by commas.

ps -o pid,comm -C xxsleep-a1,xxsleep-a2
    PID COMMAND
   2141 xxsleep-a1
   2142 xxsleep-a1
   2150 xxsleep-a2

On the Debian 12 server, we started four processes under the same names and ran [killall xxsleep-a1]; it printed nothing and finished with exit code 0. Searching again with pgrep, both xxsleep-a1 processes were gone, and only xxsleep-a2 and xxsleep-longname-x1 remained. If you give a path containing a slash (/) instead of a name, it picks processes running that file regardless of their name (per the official manual).

Giving the nonexistent name xxsleep-zz printed a line with [no process found] after the name and finished with exit code 1. The exit code is 0 only when at least one process was ended for each name given (per the official manual).

killall xxsleep-zz
xxsleep-zz: no process found

To end just one process whose number you know, use the Linux kill command to send a signal to that number only.

3️⃣ killall command options

  • ↪️ -e and 15-character names, -i, -v, -u, -r

Reading the name of the process started as xxsleep-longname-x1 from /proc/PID/comm showed only the first 15 characters, xxsleep-longnam.

cat /proc/2155/comm
xxsleep-longnam

We ran pgrep with the 16-character xxsleep-longname.

pgrep -a xxsleep-longname

It finished with no output and exit code 1, and searching again with the 15-character xxsleep-longnam showed that process.

pgrep -l xxsleep-longnam
2155 xxsleep-longnam

When killall gets a name longer than 15 characters and there are processes whose full name it can't read, it targets every process whose first 15 characters match; adding -e skips those entries (per the official manual). On the Debian 12 server, giving the 15-character xxsleep-longnam with -e and -v printed lines saying it skipped three other processes whose names were cut at 15 characters, and it ended with [no process found].

killall -e -v xxsleep-longnam
killall: skipping partial match quota_events_un(37)
killall: skipping partial match acpi_thermal_pm(112)
killall: skipping partial match ext4-rsv-conver(246)
xxsleep-longnam: no process found

Giving the full name xxsleep-longname-x1 printed the same skip lines, followed by a line showing the signal sent to that process.

killall -e -v xxsleep-longname-x1
killall: skipping partial match quota_events_un(37)
killall: skipping partial match acpi_thermal_pm(112)
killall: skipping partial match ext4-rsv-conver(246)
Killed xxsleep-longname-x1(2155) with signal 15

With -v, a line containing the name, number, and signal number appeared for each process that was sent a signal.

killall -v xxsleep-a2
Killed xxsleep-a2(2150) with signal 15

-i asks for each process whether to end it. We started two xxsleep-a1 processes again and fed y and n in turn through standard input; the two prompts appeared joined on one line, and only the first xxsleep-a1 ended while the second remained.

printf 'y\nn\n' | killall -i xxsleep-a1
Kill xxsleep-a1(2171) ? (y/N) Kill xxsleep-a1(2172) ? (y/N)

-u picks only processes owned by that account, and if you omit the name, all of that account's processes are targeted. Giving xxsleep-a1 after the account name sent a signal only to the remaining xxsleep-a1.

killall -v -u user xxsleep-a1
Killed xxsleep-a1(2172) with signal 15

-o and -y select by start time, and the time is written as a number followed by a unit s, m, h, d, w, M, or y, as in [-o 30m].

-r reads names as extended regular expressions. Passing the pattern ^xxsleep-a to pgrep showed three processes starting with xxsleep-a.

pgrep -l '^xxsleep-a'
2141 xxsleep-a1
2142 xxsleep-a1
2150 xxsleep-a2

-w waits, checking every second, until all processes that were sent a signal are gone. If a process ignores the signal or remains as a zombie, it may wait forever.

The first table below lists the check commands and killall options actually run in this post, and the killall options not run are collected in the second table based on the official manual.

📌 Checking processes and killall: results from this post

CommandTaskResult in this article
pgrep -l nameNumber and name of processes whose name contains itFour lines for xxsleep; the long name shows only its first 15 characters, xxsleep-longnam
pgrep -a nameNumber and the whole command lineThe two xxsleep-a1 processes told apart by the trailing arguments 300 and 310
pgrep -x nameOnly the numbers of processes whose name matches exactlyTwo lines for xxsleep-a1: 2141 and 2142
pidof nameNumbers running under that name, on one line2142 2141 for xxsleep-a1
ps -o pid,comm -C nameNumber and name of processes whose name matches exactly; several names separated by commasTwo xxsleep-a1 lines and one xxsleep-a2 line
cat /proc/PID/commProcess name (up to the first 15 characters)2155 is xxsleep-longnam
killall nameSIGTERM to processes with that nameBoth xxsleep-a1 processes ended with exit code 0; the nonexistent name xxsleep-zz gave no process found and exit code 1
killall -e nameNames longer than 15 characters only when the full name matchesxxsleep-longnam gave no process found; xxsleep-longname-x1 ended
killall -v namePrints a result for each process sent a signalKilled xxsleep-a2(2150) with signal 15
killall -i nameAsks for each process before ending itEntering y and n ended only the first xxsleep-a1
killall -u account nameOnly processes owned by that accountGiven with a name, only that account's xxsleep-a1 ended
killall -9 nameSIGKILL instead of SIGTERMKilled xxsleep-a2(2173) with signal 9

📎 Other options: per the official manual

OptionTask
-I, --ignore-caseCompare names case-insensitively
-g, --process-groupSignal the process group instead of the process (once per group)
-l, --listList known signal names
-n, --ns PIDOnly processes in the same PID namespace as that PID; by default, all namespaces
-o, --older-than timeOnly processes started earlier than that time (units s, m, h, d, w, M, y)
-q, --quietDon't complain if no process was ended
-r, --regexpRead names as extended regular expressions
-s, --signal signalSignal to send instead of SIGTERM
-V, --versionPrint version information
-w, --waitWait until all processes sent a signal are gone
-y, --younger-than timeOnly processes started later than that time
-Z, --context patternOnly processes whose security context matches the extended regex pattern; given before other arguments; the name can be omitted

🔲 killall command simulator

The simulator below starts with a list of the four xxsleep processes plus xxsleep-a2 of the example account user1. Tap the chips to compare which lines disappear from the list with [killall -v], [-i], and [-u]; the killall output text mimics the output from running it on the Debian 12 server.

killall command simulatorpsmisc 23.4
[root@server work]#
Works only inside your browser. The list on the left uses example values, and killall here is a mimic that follows the output text from the Debian 12 server and removes lines only from the list.

4️⃣ killall signals

  • ↪️ The -s option, killall -9, and signal numbers

Specify the signal to send by name, as in [-HUP] or [-SIGHUP], by number, as in [-1], or after the -s option (per the official manual). [killall -9 process name] sends signal 9, SIGKILL. SIGKILL is a signal a process can't catch or ignore (per the official manual), so the process ends without doing any cleanup. That's why you send it when the default signal, SIGTERM, doesn't end the process.

On the Debian 12 server, adding -9 together with -v to xxsleep-a2, started again, printed a line showing signal number 9.

killall -9 -v xxsleep-a2
Killed xxsleep-a2(2173) with signal 9

We checked signal names and numbers with [kill -l]. killall also has an -l option that prints the signal names it knows.

kill -l
 1) SIGHUP	 2) SIGINT	 3) SIGQUIT	 4) SIGILL	 5) SIGTRAP
 6) SIGABRT	 7) SIGBUS	 8) SIGFPE	 9) SIGKILL	10) SIGUSR1
11) SIGSEGV	12) SIGUSR2	13) SIGPIPE	14) SIGALRM	15) SIGTERM
16) SIGSTKFLT	17) SIGCHLD	18) SIGCONT	19) SIGSTOP	20) SIGTSTP
21) SIGTTIN	22) SIGTTOU	23) SIGURG	24) SIGXCPU	25) SIGXFSZ
26) SIGVTALRM	27) SIGPROF	28) SIGWINCH	29) SIGIO	30) SIGPWR
31) SIGSYS	34) SIGRTMIN	35) SIGRTMIN+1	36) SIGRTMIN+2	37) SIGRTMIN+3
38) SIGRTMIN+4	39) SIGRTMIN+5	40) SIGRTMIN+6	41) SIGRTMIN+7	42) SIGRTMIN+8
43) SIGRTMIN+9	44) SIGRTMIN+10	45) SIGRTMIN+11	46) SIGRTMIN+12	47) SIGRTMIN+13
48) SIGRTMIN+14	49) SIGRTMIN+15	50) SIGRTMAX-14	51) SIGRTMAX-13	52) SIGRTMAX-12
53) SIGRTMAX-11	54) SIGRTMAX-10	55) SIGRTMAX-9	56) SIGRTMAX-8	57) SIGRTMAX-7
58) SIGRTMAX-6	59) SIGRTMAX-5	60) SIGRTMAX-4	61) SIGRTMAX-3	62) SIGRTMAX-2
63) SIGRTMAX-1	64) SIGRTMAX

Entering a single number printed only that signal's name. The 15 that killall sends by default was TERM, and the 9 sent with -9 was KILL.

kill -l 15
TERM
kill -l 9
KILL

If you give a signal name that isn't in the list, a message of the form [FOO: unknown signal; killall -l lists signals.] appears (per the official manual and program text).

🔢 FAQ & Recommended Content

killall is a command from the psmisc package, and pkill is from the procps-ng package, the same as pgrep. pkill finds part of a name as an extended regular expression, like pgrep, while killall reads names as regular expressions only when you add -r (per the official manual).

The official psmisc manual says that on non-Linux systems [killall name] may not behave as expected, and to be especially careful when running it as the administrator account. On other systems, check that system's manual first.

There is a limit on how many names you can give at once: the size of an unsigned long integer multiplied by 8. That's usually 64 on 64-bit systems and 32 on 32-bit systems (per the official manual).

ℹ️ Affiliate Disclosure
This site's content contains affiliate links. When a visitor buys a product or service through one of them, the site receives a commission from the seller. The amount the buyer pays(it goes down during event discounts ↓)does not go up. Posted prices, discounts, and stock reflect the time of writing and may differ, so confirm with the seller before buying. Products are chosen and reviewed by our own standards, and commissions do not affect the order or content of reviews.

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove your humanity: 9   +   1   =