1WHEREIS(1) User Commands WHEREIS(1)
2
3
4
6 whereis - locate the binary, source, and manual page files for a com‐
7 mand
8
10 whereis [options] [-BMS directory... -f] name...
11
13 whereis locates the binary, source and manual files for the specified
14 command names. The supplied names are first stripped of leading path‐
15 name components and any (single) trailing extension of the form .ext
16 (for example: .c) Prefixes of s. resulting from use of source code
17 control are also dealt with. whereis then attempts to locate the
18 desired program in the standard Linux places, and in the places speci‐
19 fied by $PATH and $MANPATH.
20
22 -b Search only for binaries.
23
24 -m Search only for manuals.
25
26 -s Search only for sources.
27
28 -u Only show the command names that have unusual entries. A
29 command is said to be unusual if it does not have just
30 one entry of each explicitly requested type. Thus
31 'whereis -m -u *' asks for those files in the current
32 directory which have no documentation file, or more than
33 one.
34
35 -B list
36 Limit the places where whereis searches for binaries, by
37 a whitespace-separated list of directories.
38
39 -M list
40 Limit the places where whereis searches for manuals, by a
41 whitespace-separated list of directories.
42
43 -S list
44 Limit the places where whereis searches for sources, by a
45 whitespace-separated list of directories.
46
47 -f Terminates the directory list and signals the start of
48 filenames. It must be used when any of the -B, -M, or -S
49 options is used.
50
51 -l Output list of effective lookup paths the whereis is
52 using. When non of -B, -M, or -S is specified the option
53 will out hard coded paths that the command was able to
54 find on system.
55
57 To find all files in /usr/bin which are not documented in /usr/
58 man/man1 or have no source in /usr/src:
59
60 $ cd /usr/bin
61 $ whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
62
64 By default whereis tries to find files from hard-coded paths,
65 which are defined with glob patterns. The command attempst to
66 use contents of $PATH and $MANPATH environment variables as
67 default search path. The easiest way to know what paths are in
68 use is to add -l listing option. Effects of the -B, -M, and -S
69 are display with -l.
70
72 The whereis command is part of the util-linux package and is
73 available from Linux Kernel Archive ⟨ftp://ftp.kernel.org/pub
74 /linux/utils/util-linux/⟩.
75
76
77
78util-linux March 2013 WHEREIS(1)