builtin

Bash command -v — locate a command

Reports how a command name would be resolved; it may return a builtin name or an executable pathname. Does not execute the named command.

Formal Syntax & Structure

bash syntaxbash
command -v name

Parameters & Attributes

NameTypeDescription
namestringCommand to inspect.

Return Value

exit status

Zero if found, nonzero otherwise.

Working Example

Example Snippetbash
type -t printfcommand -v printf
Bash Reference