File: command.rst

package info (click to toggle)
fish 4.2.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 35,980 kB
  • sloc: python: 6,972; javascript: 1,407; sh: 1,009; xml: 411; ansic: 230; objc: 78; makefile: 20
file content (45 lines) | stat: -rw-r--r-- 1,454 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
command - run a program
=======================

Synopsis
--------

.. synopsis::

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

Description
-----------

.. only:: builder_man

          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**
    Prints all *COMMAND* found in :envvar:`PATH`, in the order found.

**-q** or **--query**
    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**)
    Prints the external command that would be executed, or prints nothing if no file with the specified name could be found in :envvar:`PATH`.

**-h** or **--help**
    Displays help about using this command.

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.