Skip to main content
Became Hot Network Question
Add Environment section
Source Link
Manuel Jordan
  • 2.2k
  • 4
  • 26
  • 61

Environment:

I have this situation for Ubuntu Server 18:04, 20:04 and Fedora Workstation 36

Environment:

I have this situation for Ubuntu Server 18:04, 20:04 and Fedora Workstation 36

deleted 111 characters in body; edited title
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

Why are the signals listsignal lists for kill -, killall -and pkill are not the same?

I did do a research aboutresearched the kill, pkill and killall commands, and I understood their most of their differences. About signalsHowever, I did do realiseam confused about the followingtheir signals:

If I run kill -l is executed appears, I see:

IfBut pkill -l is executed appearsgives:

Even when there is no a list of the signals, this command supports/uses signals, just see in the previous output that appears

And finally if, killall -l is executed appearsreturns:

  • Why are the signals listsignal lists for kill -, killall -and pkill are not the same? - it seems theoretically it is the behavior at a first glance

I assumed pkill and killall should had shown the same output thanas kill -l - and aat first glance, it seems like pkill does not support signals ...

Why the signals list for kill - killall - pkill are not the same?

I did do a research about the kill pkill and killall commands, I understood their most differences. About signals I did do realise about the following:

If kill -l is executed appears:

If pkill -l is executed appears:

Even when there is no a list of the signals this command supports/uses signals, just see in the previous output that appears

And finally if killall -l is executed appears:

  • Why the signals list for kill - killall - pkill are not the same? - it seems theoretically it is the behavior at a first glance

I assumed pkill and killall should had shown the same output than kill -l - and a first glance seems pkill does not support signals ...

Why are the signal lists for kill, killall and pkill not the same?

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:

But pkill -l gives:

Even when there is no list of signals, this command supports/uses signals, just see in the previous output that appears

And finally, killall -l returns:

  • 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.

Source Link
Manuel Jordan
  • 2.2k
  • 4
  • 26
  • 61

Why the signals list for kill - killall - pkill are not the same?

I did do a research about the kill pkill and killall commands, I understood their most differences. About signals I did do realise about the following:

If kill -l is executed appears:

 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

If pkill -l is executed appears:

pkill: invalid option -- 'l'

Usage:
 pkill [options] <pattern>

Options:
 -<sig>, --signal <sig>    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 <PGID,...>   match listed process group IDs
 -G, --group <GID,...>     match real group IDs
 -i, --ignore-case         match case insensitively
 -n, --newest              select most recently started
 -o, --oldest              select least recently started
 -P, --parent <PPID,...>   match only child processes of the given parent
 -s, --session <SID,...>   match session IDs
 -t, --terminal <tty,...>  match by controlling terminal
 -u, --euid <ID,...>       match by effective IDs
 -U, --uid <ID,...>        match by real IDs
 -x, --exact               match exactly with the command name
 -F, --pidfile <file>      read PIDs from file
 -L, --logpidfile          fail if PID file is not locked
 --ns <PID>                match the processes that belong to the same
                           namespace as <pid>
 --nslist <ns,...>         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 a list of the signals this command supports/uses signals, just see in the previous output that appears

-<sig>, --signal <sig>    signal to send (either number or name)

And finally if killall -l is executed appears:

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 the signals list for kill - killall - pkill are not the same? - it seems theoretically it is the behavior at a first glance

I assumed pkill and killall should had shown the same output than kill -l - and a first glance seems pkill does not support signals ...