# Chaining

Chaining: Did It Work? Exit Codes, && and ||.

Updated: November 10, 2026

1. [Did It Work? Exit Codes, && and ||](https://www.ask-codey.com/lessons/bash-exit-codes) (Apprentice): 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.

Source: https://www.ask-codey.com/courses/bash-in-depth/topics/bash-chaining
