Unix Exit Codes Reference

Search Unix and Linux process exit codes with POSIX and bash meanings.

Reference for Unix process exit codes including POSIX conventions, bash special codes (126, 127, 128+N) and the sysexits.h values (64-78). Searchable and runs entirely in your browser.

What does exit code 0 mean?

Exit code 0 means success — the command completed without error. By Unix convention any non-zero value indicates failure, which is why shell tests like if command; then treat 0 as true.

This is a searchable reference for Unix and Linux process exit codes — the single byte a program returns when it finishes. It combines the POSIX convention, the special codes bash assigns (126, 127, and the 128+N “killed by signal” range), and the BSD sysexits.h registry (64–78) so you can decode an exit status from any of these worlds.

How it works

An exit status is one byte, so it ranges from 0 to 255. The shell exposes it as $? after each command. Zero means success and every other value means failure. Three layers define the meanings: POSIX reserves 0 for success and treats non-zero as error; bash assigns 126 (found but not executable), 127 (command not found), and 128 + N (terminated by signal N); and sysexits.h proposes a structured set from EX_USAGE (64) to EX_CONFIG (78) for programs that want consistent, meaningful codes. Search by number, source or keyword to find the matching entry and its explanation.

Decoding signal deaths

When a process is killed by a signal, the shell reports 128 + signal. So 130 is 128 + 2 (SIGINT, i.e. Ctrl+C), 137 is 128 + 9 (SIGKILL — often the OOM killer), 139 is 128 + 11 (SIGSEGV, a segfault), and 143 is 128 + 15 (SIGTERM). To get the signal, subtract 128 from the exit code.

Example

Reading $? after a failed command:

$ ./missing-binary
bash: ./missing-binary: No such file or directory
$ echo $?
127

Exit code 127 confirms the shell could not find the command — fix the path or install the binary. Everything in this tool runs in your browser; nothing is uploaded.