Exit Codes

Standard Unix/Linux process exit codes and their meanings.

success1 code
0
Success
The command completed successfully with no errors.
general2 codes
1
General error
Catchall for general errors. Often used by programs to signal any non-specific failure.
Meaning varies by program.
2
Misuse of shell builtin
Incorrect usage of a shell builtin command or invalid arguments passed to one.
Defined by Bash.
shell3 codes
126
Command not executable
The command was found but could not be executed — typically a missing execute permission.
Permission denied.
127
Command not found
The command could not be found in PATH. Usually a typo or a missing installation.
"command not found" error.
128
Invalid exit argument
A script called exit with an invalid argument (non-integer, or out of 0–255 range).
signal8 codes
129
SIGHUP (128+1)
Process received SIGHUP — hangup detected on controlling terminal, or controlling process died.
130
SIGINT (128+2)
Process interrupted by Ctrl+C in the terminal.
131
SIGQUIT (128+3)
Process received SIGQUIT (Ctrl+\). Typically produces a core dump.
134
SIGABRT (128+6)
Process aborted — usually triggered by a failed assertion (assert()) in C/C++ code.
137
SIGKILL (128+9)
Process was killed unconditionally. Cannot be caught or ignored. Often caused by the OOM killer.
139
SIGSEGV (128+11)
Segmentation fault — the process accessed memory it was not allowed to access.
141
SIGPIPE (128+13)
Broken pipe — the process tried to write to a pipe or socket with no reader.
143
SIGTERM (128+15)
Process was gracefully terminated via SIGTERM. The default signal sent by kill.