mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 02:13:38 +08:00
3a23fdf359
Includes harmonizing the display of options and arguments, standardising terminology, using the envvar directive more broadly, adding help options to all commands that support them, simplifying some language, and tidying up multiple formatting issues. string documentation is not changed.
42 lines
1.3 KiB
ReStructuredText
42 lines
1.3 KiB
ReStructuredText
.. _cmd-command:
|
|
|
|
command - run a program
|
|
=======================
|
|
|
|
Synopsis
|
|
--------
|
|
|
|
.. synopsis::
|
|
|
|
command [OPTIONS] [COMMANDNAME [ARG ...]]
|
|
|
|
Description
|
|
-----------
|
|
|
|
**command** forces the shell to execute the program *COMMANDNAME* and ignore any functions or builtins with the same name.
|
|
|
|
The following options are available:
|
|
|
|
**-a** or **--all**
|
|
Prints all *COMMAND* found in :envvar:`PATH`, in the order found.
|
|
|
|
**-q** or **--query**
|
|
Silence output and print nothing, setting only exit status.
|
|
Implies **--search**.
|
|
For compatibility, this is also **--quiet** (deprecated).
|
|
|
|
**-v** (or **-s** or **--search**)
|
|
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.
|
|
|
|
With the **-v** option, ``command`` treats every argument as a separate command to look up and sets the exit status to 0 if any of the specified commands were found, or 127 if no commands could be found. **--quiet** used with **-v** prevents commands being printed, like ``type -q``.
|
|
|
|
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.
|