I know that, to see our last executed command is correct is shell, we use "
You should focus last command before echo $?.open that command man page. you could find the meaning of exit code.
man grep; ... EXIT STATUS The exit status is 0 if selected lines are found, and 1 if not found. If an error occurred the exit status is 2. (Note: POSIX error handling code should check for '2' or greater.) ....
man ls; Exit status: 0 if OK, 1 if minor problems (e.g., cannot access subdirectory), 2 if serious trouble (e.g., cannot access command-line argument).
man diff Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.