man-pages/man1/whereis.1.html
2021-03-31 01:06:50 +01:00

231 lines
4.9 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of WHEREIS</TITLE>
</HEAD><BODY>
<H1>WHEREIS</H1>
Section: User Commands (1)<BR>Updated: October 2014<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
whereis - locate the binary, source, and manual page files for a command
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>whereis</B>
[options]
[<B>-BMS</B>
<I>directory</I>... <I></I><B>-f</B>]
<I>name</I>...
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>whereis</B>
locates the binary, source and manual files for the specified command names.
The supplied names are first stripped of leading pathname components and any
(single) trailing extension of the form
<B>.</B><I>ext</I>
(for example:
<B>.c</B>)
Prefixes of
<B>s.</B>
resulting from use of source code control are also dealt with.
<B>whereis</B>
then attempts to locate the desired program in the standard Linux places, and
in the places specified by
<B>$PATH</B>
and
<B>$MANPATH</B>.
<P>
The search restrictions (options <B>-b</B>, <B>-m</B> and <B>-s</B>)
are cumulative and apply to the subsequent <I>name</I> patterns on
the command line. Any new search restriction resets the search mask.
For example,
<DL COMPACT><DT id="1"><DD>
<P>
<B>whereis -bm ls tr -m gcc</B>
<P>
</DL>
searches for &quot;ls&quot; and &quot;tr&quot; binaries and man pages, and for &quot;gcc&quot; man pages only.
<P>
The options <B>-B</B>, <B>-M</B> and <B>-S</B> reset search paths for the
subsequent <I>name</I> patterns. For example,
<DL COMPACT><DT id="2"><DD>
<P>
<B>whereis -m ls -M /usr/share/man/man1 -f cal</B>
<P>
</DL>
searches for &quot;ls&quot; man pages in all default paths, but for &quot;cal&quot; in
the /usr/share/man/man1 directory only.
<P>
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="3"><DT><B>-b</B><DD>
<DD>
Search for binaries.
<DT id="4"><B>-m</B><DD>
Search for manuals.
<DT id="5"><B>-s</B><DD>
Search for sources.
<DT id="6"><B>-u</B><DD>
Only show the command names that have unusual entries. A command is said to be
unusual if it does not have just one entry of each explicitly requested type.
Thus
'<B>whereis -m -u *</B>'
asks for those files in the current directory which have no documentation file,
or more than one.
<DT id="7"><B>-B </B><I>list</I><DD>
Limit the places where
<B>whereis</B>
searches for binaries, by a whitespace-separated list of directories.
<DT id="8"><B>-M </B><I>list</I><DD>
Limit the places where
<B>whereis</B>
searches for manuals and documentation in Info format, by a
whitespace-separated list of directories.
<DT id="9"><B>-S </B><I>list</I><DD>
Limit the places where
<B>whereis</B>
searches for sources, by a whitespace-separated list of directories.
<DT id="10"><B>-f</B><DD>
Terminates the directory list and signals the start of filenames. It
<I>must</I>
be used when any of the
<B>-B</B>,
<B>-M</B>,
or
<B>-S</B>
options is used.
<DT id="11"><B>-l<DD>
Output the list of effective lookup paths that
whereis</B>
is using. When none of
<B>-B</B>,
<B>-M</B>,
or
<B>-S</B>
is specified, the option will output the hard-coded paths
that the command was able to find on the system.
<DT id="12"><B>-h</B>, <B>--help</B><DD>
Display help text and exit.
<DT id="13"><B>-V</B>, <B>--version</B><DD>
Display version information and exit.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>EXAMPLE</H2>
To find all files in
<I>/usr/:bin</I>
which are not documented
in
<I>/usr/:man/:man1</I>
or have no source in
<I>/usr/:src</I>:
<DL COMPACT>
<DT id="14"><DD>
<B>cd /usr/bin</B>
<BR>
<B>whereis -u -ms -M /usr/man/man1 -S /usr/src -f *</B>
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>FILE SEARCH PATHS</H2>
By default
<B>whereis</B>
tries to find files from hard-coded paths, which are defined with glob
patterns. The command attempts to use the contents of
<B>$PATH</B>
and
<B>$MANPATH</B>
environment variables as default search path. The easiest way to know
what paths are in use is to add the
<B>-l</B>
listing option. Effects of the
<B>-B</B>,
<B>-M</B>,
and
<B>-S</B>
are displayed with
<B>-l</B>.
<P>
<A NAME="lbAH">&nbsp;</A>
<H2>ENVIRONMENT</H2>
<DL COMPACT>
<DT id="15">WHEREIS_DEBUG=all<DD>
enables debug output.
</DL>
<A NAME="lbAI">&nbsp;</A>
<H2>AVAILABILITY</H2>
The whereis command is part of the util-linux package and is available from
Linux Kernel Archive
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
<DT id="17"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="18"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="19"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="20"><A HREF="#lbAF">EXAMPLE</A><DD>
<DT id="21"><A HREF="#lbAG">FILE SEARCH PATHS</A><DD>
<DT id="22"><A HREF="#lbAH">ENVIRONMENT</A><DD>
<DT id="23"><A HREF="#lbAI">AVAILABILITY</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:29 GMT, March 31, 2021
</BODY>
</HTML>