Bash $?


Example

The exit status of the last executed function or command. Usually 0 will mean OK anything else will indicate a failure:

~> $ ls *.blah;echo $?
ls: cannot access *.blah: No such file or directory
2
~> $ ls;echo $?
testfile1 testfile2
0