Why are the signal lists for kill, killall and pkill not the same?
4
votes
3
answers
2195
views
I researched the
kill
, pkill
and killall
commands, and I understood most of their differences. However, I am confused about their signals:
If I run kill -l
, I see:
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
But pkill -l
gives:
pkill: invalid option -- 'l'
Usage:
pkill [options]
Options:
-, --signal signal to send (either number or name)
-e, --echo display what is killed
-c, --count count of matching processes
-f, --full use full process name to match
-g, --pgroup match listed process group IDs
-G, --group match real group IDs
-i, --ignore-case match case insensitively
-n, --newest select most recently started
-o, --oldest select least recently started
-P, --parent match only child processes of the given parent
-s, --session match session IDs
-t, --terminal match by controlling terminal
-u, --euid match by effective IDs
-U, --uid match by real IDs
-x, --exact match exactly with the command name
-F, --pidfile read PIDs from file
-L, --logpidfile fail if PID file is not locked
--ns match the processes that belong to the same
namespace as
--nslist list which namespaces will be considered for
the --ns option.
Available namespaces: ipc, mnt, net, pid, user, uts
-h, --help display this help and exit
-V, --version output version information and exit
For more details see pgrep(1).
Even when there is no list of signals, this command supports/uses signals, just see in the previous output that appears
-, --signal signal to send (either number or name)
And finally, killall -l
returns:
HUP INT QUIT ILL TRAP ABRT BUS FPE KILL USR1 SEGV USR2 PIPE ALRM TERM STKFLT
CHLD CONT STOP TSTP TTIN TTOU URG XCPU XFSZ VTALRM PROF WINCH POLL PWR SYS
**Question**
* Why are the _**signal lists**_ for kill
, killall
and pkill
not the same?
I assumed pkill
and killall
should had shown the same output as kill -l
- and at first glance, it seems like pkill
does not support signals.
**Environment:**
I have this situation for Ubuntu Server 18:04, 20:04 and Fedora Workstation 36
Asked by Manuel Jordan
(2108 rep)
May 16, 2022, 05:19 PM
Last activity: May 17, 2022, 01:29 PM
Last activity: May 17, 2022, 01:29 PM