Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

whence - query command type

&pagelevel(4)&pagelevel

The built-in whence command in the POSIX shell sh specifies how each name is to be specified as a command name.


Syntax


whence[ -pv] name...

-v

produces a more detailed report.

-p

does a path search for name even if name is an alias, a function, or a reserved word.

name

Name of the command to be interpreted.

Exit status

0The command was executed correctly.
>0No command named name was found.

Example

Various whence output possibilities

$ whence echo

echo

$ whence -pv echo

echo is /usr/bin/echo

$ whence -v echo
echo is a shell builtin

$ whence -v cat

cat is a tracked alias for /usr/bin/cat

See also

type