Upload Tizen:Base source
[framework/base/util-linux-ng.git] / misc-utils / whereis.1
1 .\" Copyright (c) 1980, 1990 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"     This product includes software developed by the University of
15 .\"     California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)whereis.1 from UCB 4.2
33 .TH WHEREIS 1 "8 May 1994"
34 .SH NAME
35 whereis \- locate the binary, source, and manual page files for a command
36 .SH SYNOPSIS
37 .B whereis
38 .RB [ \-bmsu ]
39 .RB [ \-BMS
40 .IR directory ...
41 .BR \-f ]
42 .IR filename ...
43 .IX  "whereis command"  ""  "\fLwhereis\fP \(em find program"
44 .IX  find "program \(em \fLwhereis\fP"
45 .IX  "locate program"  ""   "locate program \(em \fLwhereis\fP"
46 .IX  command  locate  ""   "locate \(em \fLwhereis\fP"
47 .SH DESCRIPTION
48 .B whereis
49 locates source/binary and manuals sections for specified
50 files.
51 The supplied names are first stripped of leading pathname components
52 and any (single) trailing extension of the form
53 .BI . ext\fR,\fP
54 for example,
55 .BR .c .
56 Prefixes of
57 .B s.
58 resulting from use of source code control are also dealt with.
59 .B whereis
60 then attempts to locate the desired program in
61 a list of standard Linux places.
62 .SH OPTIONS
63 .TP
64 .B \-b
65 Search only for binaries.
66 .TP
67 .B \-m
68 Search only for manual sections.
69 .TP
70 .B \-s
71 Search only for sources.
72 .TP
73 .B \-u
74 Search for unusual entries.  A file is said to be unusual if it does
75 not have one entry of each requested type.
76 Thus
77 .RB ` "whereis\ \ \-m\ \ \-u\ \ *" '
78 asks for those files in the current
79 directory which have no documentation.
80 .TP
81 .B \-B
82 Change or otherwise limit the places where
83 .B whereis
84 searches for binaries.
85 .TP
86 .B \-M
87 Change or otherwise limit the places where
88 .B whereis
89 searches for
90 manual sections.
91 .TP
92 .B \-S
93 Change or otherwise limit the places where
94 .B whereis
95 searches for sources.
96 .TP
97 .B \-f
98 Terminate the last directory list and signals the start of file names,
99 and
100 .I must
101 be used when any of the
102 .BR \-B ,
103 .BR \-M ,
104 or
105 .B \-S
106 options are used.
107 .SH EXAMPLE
108 Find all files in
109 .B /usr/bin
110 which are not documented
111 in
112 .B /usr/man/man1
113 with source in
114 .BR /usr/src :
115 .IP
116 .nf
117 .ft B
118 example% cd /usr/bin
119 example% whereis \-u \-M /usr/man/man1 \-S /usr/src \-f *
120 .fi
121 .ft R
122 .SH FILES
123 .TP 20
124 .B /{bin,sbin,etc}
125 .TP
126 .B /usr/{lib,bin,old,new,local,games,include,etc,src,man,sbin,
127 .B X386,TeX,g++-include}
128 .TP
129 .B /usr/local/{X386,TeX,X11,include,lib,man,etc,bin,games,emacs}
130 .SH "SEE ALSO"
131 .BR chdir (2V)
132 .SH BUGS
133 Since
134 .B whereis
135 uses
136 .BR chdir (2V)
137 to run faster, pathnames given with the
138 .BR \-M ,
139 .BR \-S ,
140 or
141 .B \-B
142 must be full; that is, they must begin with a
143 .RB ` / '.
144 .PP
145 .B whereis
146 has a hard-coded path, so may not always find what
147 you're looking for.
148 .SH AVAILABILITY
149 The whereis command is part of the util-linux-ng package and is available from
150 ftp://ftp.kernel.org/pub/linux/utils/util-linux-ng/.