xref: /netbsd-src/usr.sbin/makemandb/apropos.1 (revision 413d532bcc3f62d122e56d92e13ac64825a40baf)
1.\" $NetBSD: apropos.1,v 1.14 2013/11/29 23:58:23 wiz Exp $
2.\"
3.\" Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay@gmail.com>
4.\" All rights reserved.
5.\"
6.\" This code was developed as part of Google's Summer of Code 2011 program.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\"
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in
16.\"    the documentation and/or other materials provided with the
17.\"    distribution.
18.\"
19.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
22.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
23.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
24.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
25.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
27.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
29.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
31.\"
32.Dd November 22, 2013
33.Dt APROPOS 1
34.Os
35.Sh NAME
36.Nm apropos
37.Nd search the complete content of all man pages
38.Sh SYNOPSIS
39.Nm
40.Op Fl 123456789CchilPpr
41.Op Fl n Ar results
42.Op Fl S Ar machine
43.Op Fl s Ar section
44.Ar query
45.Sh DESCRIPTION
46The
47.Nm
48utility performs a full text search over the complete content of all man pages.
49It uses the FTS engine of Sqlite to perform the search.
50The database is created with the help of the
51.Xr makemandb 8
52utility.
53.Pp
54This implementation of the
55.Nm
56utility is more sophisticated than the classical version.
57Like modern search applications, it uses advanced techniques like stemming
58and term weighting to rank the matching results in decreasing order of
59relevance.
60By default
61.Nm
62will only display the top 10 matches in the output.
63.Pp
64Quotes are optional for specifying multiword queries.
65.Pp
66It supports the following options:
67.Bl -tag -width indent
68.It Fl [1-9]
69Search only within the specified section manual pages.
70.It Fl C
71Do not show the context of the match.
72.It Fl c
73Do show the context of the match (default).
74.It Fl h
75Turn on html formatting.
76.It Fl i
77Turn on terminal escape code formatting.
78.It Fl l
79Legacy mode: Only searches name and name description.
80Does not print context and turns off formatting.
81.It Fl n Ar results
82Output up to the specified number of search results.
83The default limit is infinity.
84.It Fl P
85Turn on pager formatting.
86.It Fl p
87Turn on pager formatting, and pipe the results through a pager (defaulting to
88.Xr more 1 ) .
89.It Fl r
90Turn off formatting.
91.It Fl S Ar machine
92Limit the search to the pages for the specified machine architecture.
93By default pages for all architectures are shown in the search results.
94.It Fl s Ar section
95Restrict the search to the specified section of the manual.
96By default, pages from all section are shown.
97This option is for backwards compatibility with the classic version of apropos,
98using it is equivalent to using the
99.Op 123456789
100options directly.
101.El
102.Sh FILES
103.Bl -hang -width /etc/man.conf -compact
104.It Pa /etc/man.conf
105The location of the Sqlite FTS database can be configured using the
106.Cd _mandb
107tag.
108.El
109.Sh ENVIRONMENT VARIABLES
110The
111.Ev APROPOS
112environment variables is white-space tokenized as an argument vector
113and the options in it are parsed and set.
114Command line options override the environment options.
115.Sh SEE ALSO
116.Xr man 1 ,
117.Xr whatis 1 ,
118.Xr makemandb 8
119.Sh HISTORY
120The
121.Nm
122command appeared in 3.0BSD.
123It was rewritten in
124.Nx 6.0
125to support full text search using Sqlite.
126.Sh AUTHORS
127.An Abhinav Upadhyay
128