2006-12-06 17:25:32 -06:00
|
|
|
.\" Copyright (c) 1980, 1990 The Regents of the University of California.
|
|
|
|
.\" All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)whereis.1 from UCB 4.2
|
2013-03-16 16:05:24 -05:00
|
|
|
.TH WHEREIS 1 "March 2013" "util-linux" "User Commands"
|
2006-12-06 17:25:32 -06:00
|
|
|
.SH NAME
|
|
|
|
whereis \- locate the binary, source, and manual page files for a command
|
|
|
|
.SH SYNOPSIS
|
|
|
|
.B whereis
|
2012-06-26 02:53:51 -05:00
|
|
|
.RB [ options ]
|
2009-07-22 04:29:04 -05:00
|
|
|
.RB [ \-BMS
|
2013-01-21 16:01:09 -06:00
|
|
|
.IR directory "... " \fB\-f\fR ]
|
|
|
|
.IR name ...
|
2006-12-06 17:25:32 -06:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B whereis
|
2013-01-21 16:01:09 -06:00
|
|
|
locates the binary, source and manual files for the specified command names.
|
2013-03-16 16:36:02 -05:00
|
|
|
The supplied names are first stripped of leading pathname components and any
|
|
|
|
(single) trailing extension of the form
|
2013-01-21 16:01:09 -06:00
|
|
|
.BI . ext
|
|
|
|
(for example:
|
|
|
|
.BR .c )
|
2006-12-06 17:25:32 -06:00
|
|
|
Prefixes of
|
|
|
|
.B s.
|
|
|
|
resulting from use of source code control are also dealt with.
|
|
|
|
.B whereis
|
2013-03-16 16:36:02 -05:00
|
|
|
then attempts to locate the desired program in the standard Linux places, and
|
|
|
|
in the places specified by
|
|
|
|
.B $PATH
|
|
|
|
and
|
|
|
|
.BR $MANPATH .
|
2006-12-06 17:25:32 -06:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2013-03-16 16:36:02 -05:00
|
|
|
.IP \fB\-b\fP
|
2006-12-06 17:25:32 -06:00
|
|
|
Search only for binaries.
|
2013-03-16 16:36:02 -05:00
|
|
|
.IP \fB\-m\fP
|
2013-01-21 16:01:09 -06:00
|
|
|
Search only for manuals.
|
2013-03-16 16:36:02 -05:00
|
|
|
.IP \fB\-s\fP
|
2006-12-06 17:25:32 -06:00
|
|
|
Search only for sources.
|
2013-03-16 16:36:02 -05:00
|
|
|
.IP \fB\-u\fP
|
|
|
|
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
|
|
|
|
.RB ' "whereis \-m \-u *" '
|
|
|
|
asks for those files in the current directory which have no documentation file,
|
|
|
|
or more than one.
|
2012-06-26 02:53:51 -05:00
|
|
|
.IP "\fB\-B \fIlist\fP"
|
2013-01-21 16:01:09 -06:00
|
|
|
Limit the places where
|
2006-12-06 17:25:32 -06:00
|
|
|
.B whereis
|
2013-01-21 16:01:09 -06:00
|
|
|
searches for binaries, by a whitespace-separated list of directories.
|
2012-06-26 02:53:51 -05:00
|
|
|
.IP "\fB\-M \fIlist\fP"
|
2013-01-21 16:01:09 -06:00
|
|
|
Limit the places where
|
2006-12-06 17:25:32 -06:00
|
|
|
.B whereis
|
2013-01-21 16:01:09 -06:00
|
|
|
searches for manuals, by a whitespace-separated list of directories.
|
2012-06-26 02:53:51 -05:00
|
|
|
.IP "\fB\-S \fIlist\fP"
|
2013-01-21 16:01:09 -06:00
|
|
|
Limit the places where
|
2006-12-06 17:25:32 -06:00
|
|
|
.B whereis
|
2013-01-21 16:01:09 -06:00
|
|
|
searches for sources, by a whitespace-separated list of directories.
|
2012-06-26 02:53:51 -05:00
|
|
|
.IP "\fB\-f\fP"
|
2013-01-21 16:01:09 -06:00
|
|
|
Terminates the directory list and signals the start of filenames. It
|
2006-12-06 17:25:32 -06:00
|
|
|
.I must
|
|
|
|
be used when any of the
|
|
|
|
.BR \-B ,
|
|
|
|
.BR \-M ,
|
|
|
|
or
|
2012-07-11 15:16:15 -05:00
|
|
|
.BR \-S
|
2013-01-21 16:01:09 -06:00
|
|
|
options is used.
|
2013-03-16 15:12:49 -05:00
|
|
|
.IP "\fB\-l"
|
|
|
|
Output list of effective lookup paths the
|
|
|
|
.B whereis
|
|
|
|
is using. When non of
|
|
|
|
.BR \-B ,
|
|
|
|
.BR \-M ,
|
|
|
|
or
|
|
|
|
.BR \-S
|
2013-03-16 16:36:02 -05:00
|
|
|
is specified the option will out hard coded paths that the command was able to
|
|
|
|
find on system.
|
2006-12-06 17:25:32 -06:00
|
|
|
.SH EXAMPLE
|
2013-01-21 16:01:09 -06:00
|
|
|
To find all files in
|
2013-03-16 16:36:02 -05:00
|
|
|
.B /usr/\:bin
|
2006-12-06 17:25:32 -06:00
|
|
|
which are not documented
|
|
|
|
in
|
2013-03-16 16:36:02 -05:00
|
|
|
.B /usr/\:man/\:man1
|
2013-01-21 16:01:09 -06:00
|
|
|
or have no source in
|
2013-03-16 16:36:02 -05:00
|
|
|
.BR /usr/\:src :
|
2006-12-06 17:25:32 -06:00
|
|
|
.IP
|
2013-01-21 16:01:09 -06:00
|
|
|
.B $ cd /usr/bin
|
|
|
|
.br
|
|
|
|
.B $ whereis \-u \-ms \-M /usr/man/man1 \-S /usr/src \-f *
|
2013-03-16 16:05:24 -05:00
|
|
|
.SH "FILE SEARCH PATHS"
|
|
|
|
By default
|
2012-06-26 02:53:51 -05:00
|
|
|
.B whereis
|
2013-03-16 16:05:24 -05:00
|
|
|
tries to find files from hard-coded paths, which are defined with glob
|
|
|
|
patterns. The command attempst to use contents of
|
2012-06-26 02:53:51 -05:00
|
|
|
.B $PATH
|
2013-03-16 16:05:24 -05:00
|
|
|
and
|
|
|
|
.B $MANPATH
|
|
|
|
environment variables as default search path. The easiest way to know
|
|
|
|
what paths are in use is to add
|
|
|
|
.B \-l
|
|
|
|
listing option. Effects of the
|
|
|
|
.BR \-B ,
|
|
|
|
.BR \-M ,
|
|
|
|
and
|
|
|
|
.BR \-S
|
|
|
|
are display with
|
|
|
|
.BR \-l .
|
2006-12-06 17:25:35 -06:00
|
|
|
.PP
|
2007-07-02 18:17:04 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The whereis command is part of the util-linux package and is available from
|
2013-03-16 16:36:02 -05:00
|
|
|
.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
|
|
|
|
Linux Kernel Archive
|
|
|
|
.UE .
|