BREAK(1) fish-shell BREAK(1)

# [NAME](#NAME)

break - stop the current inner loop

# [SYNOPSIS](#SYNOPSIS)

```
LOOP_CONSTRUCT


   [COMMANDS ...]


   break


   [COMMANDS ...]
end
```

# [DESCRIPTION](#DESCRIPTION)

**break** halts a currently running loop (*LOOP\_CONSTRUCT*), such as a for &lt;&gt; or while &lt;&gt; loop. It is usually added inside of a conditional block such as an if &lt;&gt; block.

The **-h** or **--help** option displays help about using this command.

# [EXAMPLE](#EXAMPLE)

The following code searches all .c files for "smurf", and halts at the first occurrence.

```
for i in *.c


    if grep smurf $i


        echo Smurfs are present in $i


        break


    end
end
```

# [SEE ALSO](#SEE_ALSO)

•

the continue &lt;&gt; command, to skip the remainder of the current iteration of the current inner loop

# [Copyright](#Copyright)

fish-shell developers

October 10, 2026 4.9

---

Document: break(1) from fish 4.9.3-r1 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
