command - Run a simple command

Synopsis

command [ -p ] command_name [ argument ... ]

command [ -vV ] command_name

Description

You can use command to run command_name with the specified arguments with functions eliminated from the search order. If command_name is a special built-in utility, then it is treated as a regular built-in utility. Otherwise, the effect of command is the same as omitting command.

Note that command -v is equivalent to whence and command -V is equivalent to whence -v.

Options

-p
Perform the command search using a default value for the PATH variable that is guaranteed to find all of the standard utilities.
-v
Write a string that shows the path name or command used by qsh to invoke command_name in the current environment.
-V
Write a string that shows how command_name is interpreted by qsh in the current environment.

Operands

command_name is a utility in the current environment.

Exit status

  • 0 when successful.
  • >0 when unsuccessful.
Examples
  1. Run the export special built-in utility as a regular built-in utility: command export ALPHA
  2. Display the path name used to invoke the ls utility: command -v ls
  3. Display how the reserved word for is interpreted: command -V for