thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Systems & Data Center · Foundational

Exit Status

The numeric code a Linux command returns on completion, where 0 means success and non-zero indicates an error.

Definition

The exit status of the last command is stored in $?. Shell operators && and || run the next command only on success or failure respectively.

Example

mount -a && echo OK || echo FAILED reports whether all fstab mounts succeeded.

Exam tip

0 is success in shells, the opposite of many programming conventions where 0 means false.

Related terms