Exit Codes Reference
Searchable reference of common Unix/Linux shell exit codes, signals, and BSD sysexits.
Searchable reference of common Unix/Linux shell exit codes, signals, and BSD sysexits.
30 of 30 exit codes
EX_OK / Success
Command completed successfully with no errors.
General error
Catchall for general errors and uncaught exceptions.
Misuse of shell builtin
Incorrect usage of a shell command — e.g. missing argument or invalid option.
Command cannot execute
The command was found but is not executable — usually a permissions problem.
Command not found
The requested command does not exist or is not in $PATH.
Invalid exit argument
Exit was called with an argument outside the 0-255 range.
Exit status out of range
Exit code was outside the valid 0-255 range, or SSH connection failed.
Terminated by Ctrl+C (SIGINT)
128 + signal number 2 (SIGINT) — process was interrupted by the user.
SIGQUIT
128 + 3 — process received a quit signal, often dumping core.
SIGILL
128 + 4 — process attempted to execute an illegal instruction.
SIGTRAP
128 + 5 — trace/breakpoint trap.
SIGABRT
128 + 6 — process called abort(), often from a failed assertion.
SIGBUS
128 + 7 — process caused a bus error (misaligned/invalid memory access).
SIGFPE
128 + 8 — fatal arithmetic error, e.g. division by zero.
SIGKILL
128 + 9 — process was forcibly killed (often by the OOM killer or `kill -9`).
SIGSEGV
128 + 11 — segmentation fault from invalid memory access.
SIGPIPE
128 + 13 — write to a pipe with no readers (common in shell pipelines).
SIGTERM
128 + 15 — process received a polite termination request (default `kill` signal).
EX_USAGE
BSD sysexits.h — command was used incorrectly (bad arguments, syntax error).
EX_DATAERR
BSD sysexits.h — input data was incorrect in some way.
EX_NOINPUT
BSD sysexits.h — input file did not exist or was unreadable.
EX_NOUSER
BSD sysexits.h — specified user did not exist.
EX_NOHOST
BSD sysexits.h — specified host did not exist.
EX_UNAVAILABLE
BSD sysexits.h — a required service is unavailable.
EX_SOFTWARE
BSD sysexits.h — an internal software error was detected.
EX_OSERR
BSD sysexits.h — an operating system error was detected (e.g. fork failure).
EX_CANTCREAT
BSD sysexits.h — a (user specified) output file could not be created.
EX_IOERR
BSD sysexits.h — an error occurred while doing I/O on some file.
EX_NOPERM
BSD sysexits.h — insufficient permission to perform the operation.
EX_CONFIG
BSD sysexits.h — something was found in an unconfigured or misconfigured state.