# For Every File: for Loops

A for loop runs the same commands once for every word, number or file in a list, so renaming 12 files or 200 takes one line, with ${f%.tmp} cutting the old ending off each name.

![Cheat sheet for the lesson For Every File: for Loops: A for loop runs the same commands once for every word, number or file in a list, so renaming 12 files or 200 takes one line, with ${f%.tmp} cutting the old ending off each name.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/6062fe03ce6744d293aec68e7ceb8553.webp)

- Category: Bash
- Level: Apprentice
- Tags: brace-expansion, for-loop, glob, linux, loop, parameter-expansion, unix
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-for-loops-cheat-sheet
