Home Explore Blog CI



nushell

book/running_externals.md
ede8f02de9a6f09fe6a24cf41e80045157088dd82c497fa50000000300000473
# Running System (External) Commands

Nu provides a set of commands that you can use across different operating systems ("internal" commands) and having this consistency is helpful when creating cross-platform code. Sometimes, though, you want to run an external command that has the same name as an internal Nu command. To run the external [`ls`](/commands/docs/ls.md) or [`date`](/commands/docs/date.md) command, for example, preface it with the caret (^) sigil. Prefacing with the caret calls the external command found in the user's `PATH` (e.g. `/bin/ls`) instead of Nu's internal [`ls`](/commands/docs/ls.md) command).

Nu internal command:

```nu
ls
```

External command (typically `/usr/bin/ls`):

```nu
^ls
```

::: note
On Windows, `ls` is a PowerShell _alias_ by default, so `^ls` will not find a matching system _command_.
:::

## Additional Windows Notes

When running an external command on Windows,
Nushell forwards some `CMD.EXE` internal commands to cmd instead of attempting to run external commands.
[Coming from CMD.EXE](coming_from_cmd.md) contains a list of these commands and describes the behavior in more detail.

Chunks
a87de4f0 (1st chunk of `book/running_externals.md`)
Title: Running External Commands in Nushell
Summary
Nushell provides internal commands that work across operating systems, but sometimes it's necessary to run an external command with the same name as an internal one. To do this, preface the command with a caret (^), which tells Nushell to use the external command found in the user's PATH. On Windows, certain CMD.EXE internal commands are forwarded to cmd when running external commands.