Did It Work? Exit Codes, && and ||

Every command ends with an exit code, 0 when it worked and another number when it didn't, which $? shows; && runs the next command only if the last one worked, || only if it failed, and ; either way.

Updated

Cheat sheet for the lesson Did It Work? Exit Codes, && and ||: Every command ends with an exit code, 0 when it worked and another number when it didn't, which $? shows; && runs the next command only if the last one worked, || only if it failed, and ; either way.
Category
Bash
Level
Apprentice
Tags
command-chaining, exit-code, linux, unix