Skip or exit loop iterations.
Section: Loops
Use break and continue
bash
bash
for n in {1..5}; do [[ $n -eq 3 ]] && continue; echo "$n"; doneExplanation
Fundamental control-flow building blocks.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Loops