Find Exit Code of Last Command Run On The Command Line
This is how you find the exist code of the last command you ran:
Code
echo $?
Results
0
A `0` is returned if there were no problems. Any non-0 value represents an error.
For example, this will return `0` (assuming `date` runs properly):
Code
date
echo $?
Results
Sat Sep 10 11:18:59 EDT 2022
0
And this will return `1` because running false returns it like an error would
Code
false
echo $?
Results
1