Home Explore Blog CI



nushell

commands/docs/exec.md
9694ea0bd829a8432ec63c6cbb190b3da6b1e26ad7d069b20000000300000447
---
title: exec
categories: |
  system
version: 0.104.0
system: |
  Execute a command, replacing or exiting the current process, depending on platform.
usage: |
  Execute a command, replacing or exiting the current process, depending on platform.
editLink: false
contributors: false
---
<!-- This file is automatically generated. Please edit the command in https://github.com/nushell/nushell instead. -->

# `exec` for [system](/commands/categories/system.md)

<div class='command-title'>Execute a command, replacing or exiting the current process, depending on platform.</div>

## Signature

```> exec {flags} ...rest```

## Parameters

 -  `...rest`: External command to run, with arguments.


## Input/output types:

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

Execute external 'ps aux' tool
```nu
> exec ps aux

```

Execute 'nautilus'
```nu
> exec nautilus

```

## Notes
On Unix-based systems, the current process is replaced with the command.
On Windows based systems, Nushell will wait for the command to finish and then exit with the command's exit code.

Chunks
75f8b1df (1st chunk of `commands/docs/exec.md`)
Title: exec command in Nushell: Execute external commands
Summary
The `exec` command in Nushell executes an external command. On Unix-based systems, it replaces the current process with the command. On Windows, Nushell waits for the command to finish and then exits with the command's exit code. The command takes a variable number of arguments that are passed to the external command.