# Line by Line: while read

while IFS= read -r line reads a file one whole line at a time, spaces and backslashes kept, and while and until repeat commands for as long as a condition is true, or until it becomes true.

![Cheat sheet for the lesson Line by Line: while read: while IFS= read -r line reads a file one whole line at a time, spaces and backslashes kept, and while and until repeat commands for as long as a condition is true, or until it becomes true.](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/b7e550563fcc4009bbd4753f74d6a826.webp)

- Category: Bash
- Level: Journeyman
- Tags: ifs, linux, redirection, standard-streams, unix, until-loop, while-loop
- Updated: November 10, 2026

Source: https://www.ask-codey.com/cheat-sheets/bash-while-read-cheat-sheet
