Exit code

The number a command returns when it ends: 0 means success, anything else is an error.

Also called: $?, &&, ||, return code

Type
Term
Source
General
Language
Bash

In plain English

$? holds the last exit code. && runs the next command only on success, || only on failure.

Example

The deploy script stopped because the tests returned exit code 1.

In code

php artisan test && git push || echo "Tests failed, not pushing"

Learn more

Related terms

Added 2026-11-30 · Last reviewed 2026-11-30