What is Exit Status Code ($?) of Last Command in Linux
The “$?” is a built-in variable that your shell uses to store the exit status code of the last executed command in integer format and remains unchanged unless the next command is executed. Using this exit status code, you can debug the problem that occurred