After each command in bash, the return code can be tested with $?. A command can also run dependent on another command succeeding with &&. This would be particularly useful if, as in the below screenshot, a directory wasn't created, and all the subsequent processes failed.

After each command in bash, the return code can be tested with $?. A command can also run dependent on another command succeeding with &&. This would be particularly useful if, as in the below screenshot, a directory wasn't created, and all the subsequent processes failed.