STD Error Bash

echo $? # to print last command error status
GitPaulo