I'm looking for textual explanation of Linux exit codes (like 124 for timeout, 130 for SIGINT received, etc).

I thought errno from moreutils does this but it seems it is for looking for error numbers? What is the difference anyway?

$ errno 124 && errno 130
EMEDIUMTYPE 124 Wrong medium type
EOWNERDEAD 130 Owner died

As you can see, these explanations are wrong.

  • 2
    I'm afraid the question is ill-posed, because programmers can decide for themselves which exit status they return in case of certain errors. This is why you usually find a RETURN CODES or EXIT STATUS section at the end of man-pages for linux programs where this is described for that program. There are some attempts to standardize, but unless you mention the program for which you are looking to understand the exit codes, it is impossible to give a definitive answer.
    – AdminBee
    Jun 29, 2021 at 9:48
  • Status codes 128 and above are not even reported by the process itself. They are generated by the kernel when processes are killed by signals, and are (128 + SigNum), where the signal numbers are given from kill -l. Values from 124 to 127 are returned by shells on behalf of processes they couldn't even start (e.g. by failure to fork or to find a command to exec). The timeout command apes this behaviour: in fact, man timeout says it will SigKill the process if it ignores the TERM signal, and return (128+9) instead of 124. Or, the process can catch the signal and exit with its own status. Jun 29, 2021 at 10:30


Browse other questions tagged or ask your own question.