]> git.saurik.com Git - apple/shell_cmds.git/blame - which/which.1
shell_cmds-207.11.1.tar.gz
[apple/shell_cmds.git] / which / which.1
CommitLineData
e1a085ba 1.\" Manpage Copyright (c) 1995, Jordan Hubbard <jkh@FreeBSD.org>
44bd5ea7
A
2.\"
3.\" Redistribution and use in source and binary forms, with or without
4.\" modification, are permitted provided that the following conditions
5.\" are met:
6.\" 1. Redistributions of source code must retain the above copyright
7.\" notice, this list of conditions and the following disclaimer.
8.\" 2. Redistributions in binary form must reproduce the above copyright
9.\" notice, this list of conditions and the following disclaimer in the
10.\" documentation and/or other materials provided with the distribution.
11.\" 3. All advertising materials mentioning features or use of this software
12.\" must display the following acknowledgement:
e1a085ba
A
13.\" This product includes software developed by the FreeBSD Project
14.\" its contributors.
15.\" 4. Neither the name of the FreeBSD Project nor the names of its contributors
44bd5ea7
A
16.\" may be used to endorse or promote products derived from this software
17.\" without specific prior written permission.
18.\"
e1a085ba
A
19.\" THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTOR ``AS IS'' AND ANY EXPRESS OR
20.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
21.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
22.\" IN NO EVENT SHALL THE CONTRIBUTOR BE LIABLE FOR ANY DIRECT, INDIRECT,
23.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
24.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28.\" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
44bd5ea7 29.\"
deb63bfb 30.\" $FreeBSD: head/usr.bin/which/which.1 267773 2014-06-23 08:23:05Z bapt $
44bd5ea7 31.\"
deb63bfb 32.Dd December 13, 2006
44bd5ea7 33.Dt WHICH 1
e1a085ba 34.Os
44bd5ea7
A
35.Sh NAME
36.Nm which
9bafe280 37.Nd "locate a program file in the user's path"
44bd5ea7
A
38.Sh SYNOPSIS
39.Nm
e1a085ba
A
40.Op Fl as
41.Ar program ...
44bd5ea7 42.Sh DESCRIPTION
e1a085ba 43The
44bd5ea7 44.Nm
e1a085ba
A
45utility
46takes a list of command names and searches the path for each executable
47file that would be run had these commands actually been invoked.
48.Pp
49The following options are available:
50.Bl -tag -width indent
51.It Fl a
52List all instances of executables found (instead of just the first one
53of each).
54.It Fl s
deb63bfb
A
55No output, just return 0 if all of the executables are found, or 1 if
56some were not found.
44bd5ea7 57.El
e1a085ba
A
58.Pp
59Some shells may provide a builtin
60.Nm
61command which is similar or identical to this utility.
62Consult the
63.Xr builtin 1
64manual page.
65.Sh SEE ALSO
66.Xr builtin 1 ,
44bd5ea7 67.Xr csh 1 ,
e1a085ba
A
68.Xr find 1 ,
69.Xr locate 1 ,
70.Xr whereis 1
44bd5ea7
A
71.Sh HISTORY
72The
73.Nm
e1a085ba
A
74command first appeared in
75.Fx 2.1 .
76.Sh AUTHORS
77.An -nosplit
78The
79.Nm
80utility was originally written in Perl and was contributed by
deb63bfb 81.An Wolfram Schneider Aq Mt wosch@FreeBSD.org .
e1a085ba
A
82The current version of
83.Nm
84was rewritten in C by
deb63bfb 85.An Daniel Papasian Aq Mt dpapasia@andrew.cmu.edu .