EXIT(1) fish-shell EXIT(1)

# [NAME](#NAME)

exit - exit the shell

# [SYNOPSIS](#SYNOPSIS)

```
exit [CODE]
```

# [DESCRIPTION](#DESCRIPTION)

**exit** is a special builtin that causes the shell to exit. Either 255 or the *CODE* supplied is used, whichever is lesser. Otherwise, the exit status will be that of the last command executed.

If exit is called while sourcing a file (using the source &lt;&gt; builtin) the rest of the file will be skipped, but the shell itself will not exit.

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

# [Copyright](#Copyright)

fish-shell developers

October 26, 2026 4.9

---

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