commands
command — inspect command resolution
Bash builtin. With -v it describes how a name is resolved; with -V it gives a more detailed description. Without either, it invokes the requested command while bypassing shell functions. Do not assume -v always prints an absolute filename.
Formal Syntax & Structure
linux syntaxlinux
command [-pVv] command [argument ...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -v | option | Concise lookup result |
| -V | option | Verbose lookup result |
| -p | option | Use a default search path |
| command | operand | Name to inspect or invoke |
| argument | operand | Arguments for invocation |
Return Value
text and exit status
Lookup mode succeeds when the name is found; otherwise nonzero. Invocation returns the command status or a lookup/execution failure.
Working Example
Example Snippetlinux
command -v cdcommand -v ls