Home Explore Blog CI



nushell

commands/docs/break.md
e2c16703c67bc009e1ecc74c198b04c9d5dd4562e22ec07b0000000300000309
---
title: break
categories: |
  core
version: 0.104.0
core: |
  Break a loop.
usage: |
  Break a loop.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `break` for [core](/commands/categories/core.md)

<div class='command-title'>Break a loop.</div>

## Signature

```> break {flags} ```


## Input/output types:

| input   | output  |
| ------- | ------- |
| nothing | nothing |
## Examples

Break out of a loop
```nu
> loop { break }

```

## Notes
This command is a parser keyword. For details, check:
  https://www.nushell.sh/book/thinking_in_nu.html

  break can only be used in while, loop, and for loops. It can not be used with each or other filter commands

Chunks
abb29649 (1st chunk of `commands/docs/break.md`)
Title: break command in Nushell
Summary
The `break` command in Nushell is used to exit a loop prematurely. It's a parser keyword that can be used within `while`, `loop`, and `for` loops, but not with `each` or other filter commands. The command takes no input and produces no output.