echo $?

Category: Shell & Bash

echo $?

Print the exit status of the last command

Shows the exit code of the last command: 0 means success, any other number means it failed or encountered an error.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.