Iterate through words or filenames.
Section: Conditionals Loops and Functions
Loop over items
bash
bash
for f in *.log; do echo "$f"; doneExplanation
Quote variables inside the loop body to handle spaces safely.
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 Conditionals Loops and Functions