# break

*verb*

say it: **“BRAYK”** **/ˈbreɪk/**

A command that stops a loop at once, so the script goes on with whatever comes after the loop.

## What does **break** do in bash?

`break` leaves the loop it's in straight away, skipping every item still to come; the script carries on after `done`. Use it when the job is finished early, such as when the songs picked already fill the drive.

```bash
total=0
while read -r minutes title; do
  [[ $(( total + minutes )) -gt 20 ]] && break
  total=$(( total + minutes ))
  echo "$title"
done < playlist.txt
```

## In a sentence

- “The menu ran once, because **break** came straight after the choice.”
- “When the next song wouldn't fit, **break** ended the loop.”

Level: Apprentice · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=2)

Updated: November 10, 2026

## In other subjects

- [break in C#](https://www.ask-codey.com/glossary/break-c-sharp)
- [break in Java](https://www.ask-codey.com/glossary/break-java)
- [break in JavaScript](https://www.ask-codey.com/glossary/break-javascript)
- [break in PowerShell](https://www.ask-codey.com/glossary/break-powershell)
- [break in Python](https://www.ask-codey.com/glossary/break)

Source: https://www.ask-codey.com/glossary/break-unix
