xref: /netbsd-src/usr.sbin/makemandb/apropos.1 (revision c5e820cae412164fcbee52f470436200af5358ea)
1.\" $NetBSD: apropos.1,v 1.4 2012/02/20 18:25:51 joerg 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 February 20, 2012
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 123456789Ccp
41.Op Fl n Ar Number of 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
51.Xr makemandb 8
52utility.
53.Pp
54This implementation of the
55.Nm
56utility is more sophisticated than the classical version of
57.Nm .
58Like modern search applications, it uses advanced techniques like stemming
59and term weighting to rank the matching results in decreasing order of
60relevance.
61By default
62.Nm
63will only display the top 10 matches in the output.
64.Pp
65Quotes are optional for specifying multiword queries.
66.Pp
67It supports the following options:
68.Bl -tag -width indent
69.It Fl 1
70Search only within section 1 manual pages.
71.It Fl 2
72Search only within section 2 manual pages.
73.It Fl 3
74Search only within section 3 manual pages.
75.It Fl 4
76Search only within section 4 manual pages.
77.It Fl 5
78Search only within section 5 manual pages.
79.It Fl 6
80Search only within section 6 manual pages.
81.It Fl 7
82Search only within section 7 manual pages.
83.It Fl 8
84Search only within section 8 manual pages.
85.It Fl 9
86Search only within section 9 manual pages.
87.It Fl C
88Do not show the context of the match.
89.It Fl c
90Do show the context of the match (default).
91.It Fl n
92Output up to the specified number of search results.
93The default limit is 10.
94.It Fl p
95Display all matching results and pipe them through a pager (defaulting to
96.Xr more 1 ) .
97.It Fl S Ar machine
98Limit the search to the pages for the specified machine architecture.
99By default pages for all architectures are shown in the search results.
100.It Fl s Ar section
101Restrict the search to the specified section of the manual.
102By default, pages from all section are shown.
103This option is for backwards compatibility with the classic version of apropos,
104using it is equivalent to using the
105.Op 123456789
106options directly.
107.El
108.Sh FILES
109.Bl -hang -width -compact
110.It Pa /var/db/man.db
111The Sqlite FTS database which contains an index of the manual pages.
112.El
113.Sh SEE ALSO
114.Xr man 1 ,
115.Xr whatis 1 ,
116.Xr makemandb 8
117.Sh AUTHORS
118.An Abhinav Upadhyay
119