1120ca2ecSJordan K. Hubbard.\" Manpage Copyright (c) 1995, Jordan Hubbard <jkh@freebsd.org> 29d6b1253SJordan K. Hubbard.\" 39d6b1253SJordan K. Hubbard.\" Redistribution and use in source and binary forms, with or without 49d6b1253SJordan K. Hubbard.\" modification, are permitted provided that the following conditions 59d6b1253SJordan K. Hubbard.\" are met: 69d6b1253SJordan K. Hubbard.\" 1. Redistributions of source code must retain the above copyright 79d6b1253SJordan K. Hubbard.\" notice, this list of conditions and the following disclaimer. 89d6b1253SJordan K. Hubbard.\" 2. Redistributions in binary form must reproduce the above copyright 99d6b1253SJordan K. Hubbard.\" notice, this list of conditions and the following disclaimer in the 109d6b1253SJordan K. Hubbard.\" documentation and/or other materials provided with the distribution. 119d6b1253SJordan K. Hubbard.\" 3. All advertising materials mentioning features or use of this software 129d6b1253SJordan K. Hubbard.\" must display the following acknowledgement: 139d6b1253SJordan K. Hubbard.\" This product includes software developed by the FreeBSD Project 149d6b1253SJordan K. Hubbard.\" its contributors. 159d6b1253SJordan K. Hubbard.\" 4. Neither the name of the FreeBSD Project nor the names of its contributors 169d6b1253SJordan K. Hubbard.\" may be used to endorse or promote products derived from this software 179d6b1253SJordan K. Hubbard.\" without specific prior written permission. 183819b413SWolfram Schneider.\" 199d6b1253SJordan K. Hubbard.\" THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND ANY EXPRESS OR 209d6b1253SJordan K. Hubbard.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 219d6b1253SJordan K. Hubbard.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 229d6b1253SJordan K. Hubbard.\" IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT, 239d6b1253SJordan K. Hubbard.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 249d6b1253SJordan K. Hubbard.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 259d6b1253SJordan K. Hubbard.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 269d6b1253SJordan K. Hubbard.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 279d6b1253SJordan K. Hubbard.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 289d6b1253SJordan K. Hubbard.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 299d6b1253SJordan K. Hubbard.\" 30c3aac50fSPeter Wemm.\" $FreeBSD$ 319d6b1253SJordan K. Hubbard.Dd January 26, 1995 329d6b1253SJordan K. Hubbard.Dt WHICH 1 339d6b1253SJordan K. Hubbard.Os FreeBSD 349d6b1253SJordan K. Hubbard.Sh NAME 359d6b1253SJordan K. Hubbard.Nm which 369d6b1253SJordan K. Hubbard.Nd "locate a program file in the user's path" 379d6b1253SJordan K. Hubbard.Sh SYNOPSIS 388fe908efSRuslan Ermilov.Nm 3935bff0b9SSatoshi Asami.Op Fl as 409d6b1253SJordan K. Hubbard.Op Ar command 419d6b1253SJordan K. Hubbard.Ar ... 429d6b1253SJordan K. Hubbard.Sh DESCRIPTION 439d6b1253SJordan K. Hubbard.Nm Which 449d6b1253SJordan K. Hubbardtakes a list of command names and searches the path for each executable 459d6b1253SJordan K. Hubbardfile that would be run had these commands actually been invoked. 4635bff0b9SSatoshi Asami.Pp 4735bff0b9SSatoshi AsamiThe following options are available: 4835bff0b9SSatoshi Asami.Bl -tag -width indent 4935bff0b9SSatoshi Asami.It Fl a 5035bff0b9SSatoshi AsamiList all instances of executables found (instead of just the first one 5135bff0b9SSatoshi Asamiof each). 5235bff0b9SSatoshi Asami.It Fl s 5335bff0b9SSatoshi AsamiNo output, just return 0 if any of the executables are found, or 1 if 5435bff0b9SSatoshi Asaminone are found. 5521a6eb09SSheldon Hearn.El 56c644db6aSSheldon Hearn.Pp 57c644db6aSSheldon HearnSome shells may provide a builtin 58c644db6aSSheldon Hearn.Nm 59e6d3cf26SSheldon Hearncommand which is similar or identical to this utility. 60e6d3cf26SSheldon HearnConsult the 61c644db6aSSheldon Hearn.Xr builtin 1 62c644db6aSSheldon Hearnmanual page. 639d6b1253SJordan K. Hubbard.Sh HISTORY 649d6b1253SJordan K. HubbardThe 659d6b1253SJordan K. Hubbard.Nm 6685cf659aSMike Pritchardcommand first appeared in 6785cf659aSMike Pritchard.Fx 2.1 . 689d6b1253SJordan K. Hubbard.Sh SEE ALSO 69c644db6aSSheldon Hearn.Xr builtin 1 , 70c644db6aSSheldon Hearn.Xr csh 1 , 7141cbb624SJoseph Koshy.Xr find 1 , 7241cbb624SJoseph Koshy.Xr locate 1 , 736a34c725SJoseph Koshy.Xr perl 1 , 746a34c725SJoseph Koshy.Xr whereis 1 75306005e7SPhilippe Charnier.Sh AUTHORS 769d6b1253SJordan K. HubbardThe PERL script for this more modern version of 7793a35425SPhilippe Charnier.Nm 7893a35425SPhilippe Charnierwas written by 7993a35425SPhilippe Charnier.An Wolfram Schneider Aq wosch@FreeBSD.org . 80