[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.


Locate a program file (UNIX)


which [-afLl] program...


Find all occurrences of program in PATH.
Display the full pathname.
Display the long format (as in ls -l) for each program found, displaying link information if the file is a symlink.
("el") Display the long format (as in ls -l) for each program found.


The which utility searches the filesystem for each program specified. The user's PATH environment variable is used as the search path.


Display the full pathname (including the node) and long status for all versions of the ls utility found in PATH:

which -alf ls

Display the pathname for the which utility:

which which

Environment variables:

A colon-separated list of directories to search for executables.

Exit status:

All input files were found.
An error occurred.

See also:

ls, whence (builtin ksh command)

[Previous] [Contents] [Index] [Next]