EXEC(1) fish-shell EXEC(1)

# [NAME](#NAME)

exec - execute command in current process

# [SYNOPSIS](#SYNOPSIS)

```
exec COMMAND
```

# [DESCRIPTION](#DESCRIPTION)

NOTE: This page documents the fish builtin **exec**. To see the documentation on any non-fish versions, use **command man exec**.

**exec** replaces the currently running shell with a new command. On successful completion, **exec** never returns. **exec** cannot be used inside a pipeline.

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

# [EXAMPLE](#EXAMPLE)

**exec emacs** starts up the emacs text editor, and exits **fish**. When emacs exits, the session will terminate.

# [Copyright](#Copyright)

fish-shell developers

October 10, 2026 4.9

---

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