Use arithmetic syntax in Bash for loops.
Section: Loops
C-style arithmetic for loop
bash
bash
for ((i=0; i<5; i++)); do echo "$i"; doneExplanation
Helpful for counters and indexed arrays.
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