Faster and more capable whatis(1)/apropos(1)
Contributed by tbert on Tue Apr 22 15:02:20 2014 (GMT)
from the search me, man! dept.
Not one to get lost in the OpenSSL/m2k14 shuffle, Ingo Schwarze (schwarze@) has, after
much work and improvement, updated the man page search functionality:
Date: Fri, 18 Apr 2014 04:00:48 -0600 (MDT)
From: Ingo Schwarze
Subject: CVS: cvs.openbsd.org: src
Module name: src
Changes by: firstname.lastname@example.org 2014/04/18 04:00:48
etc : weekly
libexec : Makefile
usr.bin : Makefile
usr.bin/mandoc : Makefile
usr.sbin/pkg_add/OpenBSD: Add.pm Delete.pm Paths.pm PkgCreate.pm
share/man : Makefile
share/man/man8 : daily.8
Switch to the new makewhatis(8)/apropos(1)/whatis(1) combo.
"commit the switch now" espie@ "go for it" deraadt@
See the apropos(1) manual for a description of what's new.
On machines where you want the full functionality,
run "sudo makewhatis" and put "MAKEWHATISARGS=' '" into weekly.local(8).
Otherwise, when upgrading via source, run "sudo makewhatis -Q".
Users now have a powerful tool with which to more easily find information in the already-superb documentation.
To quote the
The apropos utility queries manual page databases generated by
makewhatis(8), evaluating [the search] expression for each file in each
database...Queries evaluate over a subset of mdoc(7) macros indexed by makewhatis(8).
The EXAMPLES section displays some of the wealth of possibilities:
Search for ".cf" as a substring of manual names and descriptions:
$ apropos .cf
Include matches for ".cnf" and ".conf" as well:
$ apropos .cf .cnf .conf
Search in names and descriptions using a regular expression:
$ apropos '~set.?[ug]id'
Search for manuals in the library section mentioning both the "optind"
and the "optarg" variables:
$ apropos -s 3 Va=optind -a Va=optarg
Do exactly the same as calling whatis(1) with the argument "ssh":
$ apropos -- -i 'Nm~[[:<:]]ssh[[:>:]]'
The following two invocations are equivalent:
$ apropos -S arch -s section expression
$ apropos \( expression \) -a arch~^(arch|any)$ -a sec~^section$
For those of you attending BSDCan, Ingo will be
presenting a talk
that goes into much more depth about the improvements he's been making.
<< Call for Testing: vlan(4) improvements (Update updated) | Reply | Flattened | Expanded | It's Official: The OpenSSL Overhaul Is A Fork: Welcome LibreSSL in OpenBSD 5.6 >>
Re: Faster and more capable whatis(1)/apropos(1) (mod -2/28)
by jdv (220.127.116.11) (email@example.com) on Fri Apr 25 13:58:01 2014 (GMT)
So, I can't quite tell from the documentation, but it looks like mandoc(1) is a replacement and improvement for man(1).
Or is mandoc(1) expected to be used to generate various document renditions from source (including legacy man)? I'm unclear on the relationship between classic man and mandoc, and the roadmap ahead.
Except running the actual mandoc command seems to imply that you need to know the section you are interested in. e.g., to get traditional:
$ mandoc mandoc.1
So, you can "format and display" documents, but I gather mandoc is more about the former than the latter.
Furthermore, if I want these benefits, I should retrain my muscle memory to use "apropos ..." instead of "man -k ..." Is that right?
Hopefully the slides from the BSDCan presentation will be published next month, as I could probably use the homework.
[ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]
Add Story |
Copyright © 2004-2008
All rights reserved.
Articles and comments are copyright their respective authors,
submission implies license to publish on this web site.
Contents of the archive prior to April 2nd 2004 as well as images
and HTML templates were copied from the fabulous original
Jim's kind permission.
Some icons from slashdot.org
used with permission from Kathleen.
This journal runs as CGI with
on OpenBSD, the
source code is
Search engine is ht://Dig.
undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]