kill [-s sigspec] [-n signum] [-sigspec] jobspec or pid

kill -l [exit_status]

Send a signal specified by sigspec or signum to the process named by job specification jobspec or process id pid. sigspec is either a case-insensitive signal name such as SIGINT (with or without the SIG prefix) or a signal number; signum is a signal number. If sigspec and signum are not present, SIGTERM is used. The -l option lists the signal names. If any arguments are supplied when -l is given, the names of the signals corresponding to the arguments are listed, and the return status is zero. exit status is a number specifying a signal number or the exit status of a process terminated by a signal. The return status is zero if at least one signal was successfully sent, or non-zero if an error occurs or an invalid option is encountered.

I was wondering what kind of value exit_status can take?

What does "exit status is a number specifying a signal number or the exit status of a process terminated by a signal" mean?

  • what o/s or linux flavor is this. on OS X, its pretty clear -- -l [exit_status] If no operand is given, list the signal names; otherwise, write the signal name corresponding to exit_status. – jai_s Dec 4 '16 at 4:02
  • Sorry. kill is a builtin in bash. – Tim Dec 4 '16 at 6:09

Just exactly as the text says, you can supply one of two things:

  • a number specifying a signal number: the signals are numbered 1, 2, 3, etc... (as you can see from the usage message for the common invocation). So you can ask kill -l to give you the name corresponding to such a number.
  • the exit status of a process terminated by a signal: when processes are killed by a signal, they get a special exit status that is (usually? always?) 128 + the signal number that caused them to die. So you can ask kill -l to document that too.
  • Thanks. How can I use 'kill -l' to do the second thing instead of the first thing? – Tim Dec 4 '16 at 6:09
  • For example, kill -l 139 displays SEGV, meaning that a process exiting with exit status 139 was terminated because it received signal SIGSEGV (11). – AlexP Dec 4 '16 at 7:47
  • @Tim: you just give it an appropriate exit status. – Celada Dec 4 '16 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.