1whereis(1B) SunOS/BSD Compatibility Package Commands whereis(1B)
2
3
4
6 whereis - locate the binary, source, and manual page files for a com‐
7 mand
8
10 /usr/ucb/whereis [-bmsu] [-BMS directory... -f] filename...
11
12
14 The whereis utility locates source/binary and manuals sections for
15 specified files. The supplied names are first stripped of leading path‐
16 name components and any (single) trailing extension of the form .ext,
17 for example, .c. Prefixes of s. resulting from use of source code con‐
18 trol are also dealt with. whereis then attempts to locate the desired
19 program in a list of standard places:
20
21 etc
22 /sbin
23 /usr/bin
24 /usr/ccs/bin
25 /usr/ccs/lib
26 /usr/lang
27 /usr/lbin
28 /usr/lib
29 /usr/sbin
30 /usr/ucb
31 /usr/ucblib
32 /usr/ucbinclude
33 /usr/games
34 /usr/local
35 /usr/local/bin
36 /usr/new
37 /usr/old
38 /usr/hosts
39 /usr/include
40 /usr/etc
41
42
43
45 The following options are supported:
46
47 -b Searches only for binaries.
48
49
50 -B Changes or otherwise limits the places where whereis searches for
51 binaries.
52
53
54 -f Terminates the last directory list and signals the start of file
55 names, and must be used when any of the -B, -M, or -S options are
56 used.
57
58
59 -m Searches only for manual sections.
60
61
62 -M Changes or otherwise limits the places where whereis searches for
63 manual sections.
64
65
66 -s Searches only for sources.
67
68
69 -S Changes or otherwise limit the places where whereis searches for
70 sources.
71
72
73 -u Searches for unusual entries. A file is said to be unusual if it
74 does not have one entry of each requested type. Thus `whereis -m
75 -u *' asks for those files in the current directory which have no
76 documentation.
77
78
80 Example 1 Finding files
81
82
83 Find all files in /usr/bin which are not documented in
84 /usr/share/man/man1 with source in /usr/src/cmd:
85
86
87 example% cd /usr/ucb
88 example% whereis -u -M /usr/share/man/man1 -S /usr/src/cmd -f *
89
90
91
93 o /usr/src/*
94
95 o /usr/{doc,man}/*
96
97 o /etc, /usr/{lib,bin,ucb,old,new,local}
98
100 See attributes(5) for descriptions of the following attributes:
101
102
103
104
105 ┌─────────────────────────────┬─────────────────────────────┐
106 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
107 ├─────────────────────────────┼─────────────────────────────┤
108 │Availability │SUNWscpu │
109 └─────────────────────────────┴─────────────────────────────┘
110
112 chdir(2), attributes(5)
113
115 Since whereis uses chdir(2) to run faster, pathnames given with the -M,
116 -S, or -B must be full; that is, they must begin with a `/'.
117
118
119
120SunOS 5.11 10 Jan 2000 whereis(1B)