By POSIX and Unix/Linux convention, when a process terminates it returns an exit status (exit code) to the parent process or shell. An exit status of 0 signifies that the process completed successfully with no errors. Any non-zero exit status indicates that some kind of error or abnormal condition occurred during execution. This convention is used consistently by shells, scripts, and system utilities to determine success or failure of a command.
Community Discussion