.TH which "" "" Command
.PC "Locate executable files"
\fBwhich \fIcommand ...\fR
.PP
.B which
displays the full path name associated with
.IR command .
It searches the directories named by environment variable
.B PATH
for the first executable that matches
.I command
and that you have permission to execute.
If
.B which
can find no executable that matches your request,
an error message is displayed.
.SH Example
The following example displays
the path names that correspond to commands
.BR write ,
.BR vi ,
.BR myprog ,
and
.BR fsck :
.DM
	which write vi myprog fsck
.DE
.SH "See Also"
.Xr "commands," commands
.Xr "find," find
.Xr "PATH," path
.Xr "qfind," qfind
.Xr "whereis" whereis
