Everytime that a bash command is performed, a status code is returned indicating if the command runs with or without errors.
By convention the code 0 means that command was executed successfully, any other exit code will indicate an error on command execution.
To verify the last status code after run a command or a bash script, you can use $?
:
# example
> date
Mon Jul 28 10:33:34 PM -03 2025
> $?
0
last updated: