Home Explore Blog CI



nushell

commands/docs/exit.md
a25f70d50a71ad5d41f897d657c548c306ebe7535ae0ff63000000030000026a
---
title: exit
categories: |
  shells
version: 0.104.0
shells: |
  Exit Nu.
usage: |
  Exit Nu.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `exit` for [shells](/commands/categories/shells.md)

<div class='command-title'>Exit Nu.</div>

## Signature

```> exit {flags} (exit_code)```

## Parameters

 -  `exit_code`: Exit code to return immediately with.


## Input/output types:

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

Exit the current shell
```nu
> exit

```

Chunks
7b0f6496 (1st chunk of `commands/docs/exit.md`)
Title: exit
Summary
The `exit` command in Nushell is designed to terminate the current shell session. This command belongs to the 'shells' category within Nushell's command set. It's a straightforward command with the primary function of exiting the Nu shell environment. It accepts an optional argument, `exit_code`, which allows the user to specify the exit code that the shell should return upon termination. This can be useful for scripting purposes or when the exit status needs to be communicated to a parent process. Without an argument, the shell will typically exit with a success code (usually 0). The command takes no input and produces no output, other than the termination of the shell process. Usage is simple: either type 'exit' to exit with a default code or 'exit <exit_code>' to exit with a specific code. This command is available from Nushell version 0.104.0 onwards.