COMMAND(1) fish-shell COMMAND(1)

# [NAME](#NAME)

command - run a program

# [SYNOPSIS](#SYNOPSIS)

```
command [OPTIONS] [COMMANDNAME [ARG ...]]
```

# [DESCRIPTION](#DESCRIPTION)

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

**command** forces the shell to execute the program *COMMANDNAME* and ignore any functions or builtins with the same name.

In **command foo**, **command** is a keyword.

The following options are available:

[**-a** or **--all**](#a)

Prints all *COMMAND* found in **PATH** &lt;#envvar-PATH&gt;, in the order found.

[**-q** or **--query**](#q)

Return 0 if any of the given commands could be found, 127 otherwise. Don't print anything. For compatibility, this is also **--quiet** (deprecated).

[**-s** or **--search** (or **-v**)](#s)

Prints the external command that would be executed, or prints nothing if no file with the specified name could be found in **PATH** &lt;#envvar-PATH&gt;.

[**-h** or **--help**](#h)

Displays help about using this command.

# [EXAMPLES](#EXAMPLES)

```
command ls executes the ls program, even if an ls function also exists.
command -s ls prints the path to the ls program.
command -q git; and command git log runs git log only if git exists.
command -sq git and command -q git and command -vq git return true (0) if a git command could be found and don't print anything.
```

# [Copyright](#Copyright)

fish-shell developers

September 9, 2026 4.9

---

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