]>
Commit | Line | Data |
---|---|---|
6dbe3af9 KZ |
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 | |
25206ba6 | 33 | .TH WHEREIS 1 "June 2012" "util-linux" "User Commands" |
6dbe3af9 KZ |
34 | .SH NAME |
35 | whereis \- locate the binary, source, and manual page files for a command | |
36 | .SH SYNOPSIS | |
37 | .B whereis | |
25206ba6 | 38 | .RB [ options ] |
fd5ccc69 PB |
39 | .RB [ \-BMS |
40 | .IR directory ... | |
41 | .BR \-f ] | |
42 | .IR filename ... | |
6dbe3af9 KZ |
43 | .SH DESCRIPTION |
44 | .B whereis | |
25206ba6 | 45 | locates source/binary and manuals sections for specified files. |
6dbe3af9 KZ |
46 | The supplied names are first stripped of leading pathname components |
47 | and any (single) trailing extension of the form | |
fd5ccc69 | 48 | .BI . ext\fR,\fP |
6dbe3af9 KZ |
49 | for example, |
50 | .BR .c . | |
51 | Prefixes of | |
52 | .B s. | |
53 | resulting from use of source code control are also dealt with. | |
54 | .B whereis | |
55 | then attempts to locate the desired program in | |
2b6fc908 | 56 | a list of standard Linux places. |
6dbe3af9 KZ |
57 | .SH OPTIONS |
58 | .TP | |
25206ba6 | 59 | .IP "\fB\-b\fP" |
6dbe3af9 | 60 | Search only for binaries. |
25206ba6 | 61 | .IP "\fB\-m\fP" |
6dbe3af9 | 62 | Search only for manual sections. |
25206ba6 | 63 | .IP "\fB\-s\fP" |
6dbe3af9 | 64 | Search only for sources. |
25206ba6 | 65 | .IP "\fB\-u\fP" |
6dbe3af9 | 66 | Search for unusual entries. A file is said to be unusual if it does |
25206ba6 | 67 | not have one entry of each requested type. Thus |
6dbe3af9 KZ |
68 | .RB ` "whereis\ \ \-m\ \ \-u\ \ *" ' |
69 | asks for those files in the current | |
70 | directory which have no documentation. | |
25206ba6 | 71 | .IP "\fB\-B \fIlist\fP" |
6dbe3af9 KZ |
72 | Change or otherwise limit the places where |
73 | .B whereis | |
25206ba6 KZ |
74 | searches for binaries by white-space separated list of directories. |
75 | .IP "\fB\-M \fIlist\fP" | |
6dbe3af9 KZ |
76 | Change or otherwise limit the places where |
77 | .B whereis | |
25206ba6 KZ |
78 | searches for manual sections by white-space separated list of directories. |
79 | .IP "\fB\-S \fIlist\fP" | |
6dbe3af9 KZ |
80 | .B \-S |
81 | Change or otherwise limit the places where | |
82 | .B whereis | |
25206ba6 KZ |
83 | searches for sources white-space separated list of directories. |
84 | .IP "\fB\-f\fP" | |
6dbe3af9 KZ |
85 | Terminate the last directory list and signals the start of file names, |
86 | and | |
87 | .I must | |
88 | be used when any of the | |
89 | .BR \-B , | |
90 | .BR \-M , | |
91 | or | |
25206ba6 | 92 | .BB \-S |
6dbe3af9 KZ |
93 | options are used. |
94 | .SH EXAMPLE | |
95 | Find all files in | |
96 | .B /usr/bin | |
97 | which are not documented | |
98 | in | |
99 | .B /usr/man/man1 | |
100 | with source in | |
101 | .BR /usr/src : | |
102 | .IP | |
103 | .nf | |
104 | .ft B | |
25206ba6 KZ |
105 | $ cd /usr/bin |
106 | $ whereis \-u \-M /usr/man/man1 \-S /usr/src \-f * | |
6dbe3af9 KZ |
107 | .fi |
108 | .ft R | |
109 | .SH FILES | |
25206ba6 KZ |
110 | .B whereis |
111 | has basic set of hard-coded paths (see below). If the option | |
112 | .B \-B | |
113 | is not specified then also follows | |
114 | .B $PATH | |
115 | environment variable (since version 2.21). | |
116 | ||
6dbe3af9 | 117 | .TP 20 |
25206ba6 | 118 | /{bin,sbin,etc} |
6dbe3af9 | 119 | .TP |
25206ba6 | 120 | /usr/{lib,bin,old,new,local,games,include,etc,src,man,sbin,X386,TeX,g++-include} |
6dbe3af9 | 121 | .TP |
25206ba6 | 122 | /usr/local/{X386,TeX,X11,include,lib,man,etc,bin,games,emacs} |
2b6fc908 | 123 | .SH "SEE ALSO" |
6dbe3af9 KZ |
124 | .BR chdir (2V) |
125 | .SH BUGS | |
126 | Since | |
127 | .B whereis | |
128 | uses | |
129 | .BR chdir (2V) | |
130 | to run faster, pathnames given with the | |
131 | .BR \-M , | |
132 | .BR \-S , | |
133 | or | |
134 | .B \-B | |
135 | must be full; that is, they must begin with a | |
136 | .RB ` / '. | |
2b6fc908 | 137 | .PP |
86d62711 | 138 | .SH AVAILABILITY |
601d12fb KZ |
139 | The whereis command is part of the util-linux package and is available from |
140 | ftp://ftp.kernel.org/pub/linux/utils/util-linux/. |