1WHEREIS(1) User Commands WHEREIS(1)
2
3
4
6 whereis - locate the binary, source, and manual page files for a
7 command
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
15 pathname components. Prefixes of s. resulting from use of source code
16 control are also dealt with. whereis then attempts to locate the
17 desired program in the standard Linux places, and in the places
18 specified by $PATH and $MANPATH.
19
20 The search restrictions (options -b, -m and -s) are cumulative and
21 apply to the subsequent name patterns on the command line. Any new
22 search restriction resets the search mask. For example,
23
24 whereis -bm ls tr -m gcc
25
26 searches for "ls" and "tr" binaries and man pages, and for "gcc" man
27 pages only.
28
29 The options -B, -M and -S reset search paths for the subsequent name
30 patterns. For example,
31
32 whereis -m ls -M /usr/share/man/man1 -f cal
33
34 searches for "ls" man pages in all default paths, but for "cal" in the
35 /usr/share/man/man1 directory only.
36
38 -b
39 Search for binaries.
40
41 -m
42 Search for manuals.
43
44 -s
45 Search for sources.
46
47 -u
48 Only show the command names that have unusual entries. A command is
49 said to be unusual if it does not have just one entry of each
50 explicitly requested type. Thus 'whereis -m -u *' asks for those
51 files in the current directory which have no documentation file, or
52 more than one.
53
54 -B list
55 Limit the places where whereis searches for binaries, by a
56 whitespace-separated list of directories.
57
58 -M list
59 Limit the places where whereis searches for manuals and
60 documentation in Info format, by a whitespace-separated list of
61 directories.
62
63 -S list
64 Limit the places where whereis searches for sources, by a
65 whitespace-separated list of directories.
66
67 -f
68 Terminates the directory list and signals the start of filenames.
69 It must be used when any of the -B, -M, or -S options is used.
70
71 -l
72 Output the list of effective lookup paths that whereis is using.
73 When none of -B, -M, or -S is specified, the option will output the
74 hard-coded paths that the command was able to find on the system.
75
76 -g
77 Interpret the next names as a glob(7) patterns. whereis always
78 compares only filenames (aka basename) and never complete path.
79 Using directory names in the pattern has no effect. Don’t forget
80 that the shell interprets the pattern when specified on the command
81 line without quotes. It’s necessary to use quotes for the name, for
82 example:
83
84 whereis -g 'find*'
85
86 -h, --help
87 Display help text and exit.
88
89 -V, --version
90 Print version and exit.
91
93 By default whereis tries to find files from hard-coded paths, which are
94 defined with glob patterns. The command attempts to use the contents of
95 $PATH and $MANPATH environment variables as default search path. The
96 easiest way to know what paths are in use is to add the -l listing
97 option. Effects of the -B, -M, and -S are displayed with -l.
98
100 WHEREIS_DEBUG=all
101 enables debug output.
102
104 To find all files in /usr/bin which are not documented in /usr/man/man1
105 or have no source in /usr/src:
106
107 cd /usr/bin
108 whereis -u -ms -M /usr/man/man1 -S /usr/src -f *
109
111 For bug reports, use the issue tracker at
112 https://github.com/util-linux/util-linux/issues.
113
115 The whereis command is part of the util-linux package which can be
116 downloaded from Linux Kernel Archive
117 <https://www.kernel.org/pub/linux/utils/util-linux/>.
118
119
120
121util-linux 2.39.2 2023-06-14 WHEREIS(1)