which, whereis

display full path name for executable command

Command


SYNOPSIS

which [-a] command ...

whereis command ...


DESCRIPTION

For each command, which looks through the directories in the search path, and displays the name of the first executable file that matches command.

which is intended to find commands that are executed when the MKS KornShell is not being used.

The whereis command is equivalent to specifying which -a.

Options

-a

displays all matching executable files from every directory in PATH, not just the first match. This can help you find conflicts between two executables of the same name.


ENVIRONMENT VARIABLES

PATH

contains a list of directories for which to search when looking for command.


DIAGNOSTICS

Possible exit status values are:
0

An appropriate executable file can be found with the current PATH.

1

Failure due to any of the following:

— an appropriate executable file cannot be found
— invalid command line option


PORTABILITY

Available on some UNIX systems.

NOTE

This command does not know about shell keywords, aliases, functions, etc., nor does it report .ksh or .sh files. For this reason, whence is recommended when you are using the MKS KornShell.

SEE ALSO

Commands:
command, sh, whence


Updated MKS Toolkit [3khat16.ico]HP3000 [3khat16.ico]3kMail [archive16.gif]