OpenBSD Journal
Home : : Add Story : : Archives : : About : : Create Account : : Login :
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 
To: source-changes@cvs.openbsd.org
Subject: CVS: cvs.openbsd.org: src

CVSROOT:        /cvs
Module name:    src
Changes by:     schwarze@cvs.openbsd.org        2014/04/18 04:00:48

Modified files:
        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

Log message:
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 apropos(1) man page:

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.

[topicsysadmin]

<< Call for Testing: vlan(4) improvements (Update updated) | Reply | Flattened | Collapsed | It's Official: The OpenSSL Overhaul Is A Fork: Welcome LibreSSL in OpenBSD 5.6 >>

Threshold: Help

Related Links
more by tbert


  Re: Faster and more capable whatis(1)/apropos(1) (mod 3/29)
by sneaker (204.11.200.61) on Wed Apr 23 20:29:36 2014 (GMT)
  Thanks!
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 1/27)
by thomasw_ (108.172.20.101) (thomas.wildeman@gmail.com) on Fri Apr 25 00:31:05 2014 (GMT)
  this sounds useful, effective and eloquent to use. look forward to giving it a spin; thanks heaps, Ingo.
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod -2/28)
by jdv (216.16.224.222) (jdv@clevermonkey.org) on Fri Apr 25 13:58:01 2014 (GMT)
http://clvrmnky.org/
  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 ]

       
Re: Faster and more capable whatis(1)/apropos(1) (mod 0/26)
by Anonymous Coward (84.163.38.152) on Sat Apr 26 01:04:44 2014 (GMT)
  mandoc(1) is not a replacement for man(1), but for "groff -mandoc"; see man.conf(5) to learn how man(1) uses it. There isn't much of a roadmap regarding plain mandoc(1), i mostly completed that work three years ago. Oh well, i still have some ideas, yeah...

There is no need to change any muscle memory. man(1) invokes mandoc(1) and apropos(1) as needed by default. For example, "man -k An=Gray -a Xr=pci" works just fine and does the same as "apropos An=Gray -a Xr=pci".

Your questions are a bit basic to find answers in my slides; i didn't even explain much of what you are asking in my first talk three years ago: http://www.bsdcan.org/2011/schedule/events/230.en.html
http://www.openbsd.org/papers/bsdcan11-mandoc-openbsd.html
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

         
Re: Faster and more capable whatis(1)/apropos(1) (mod 2/24)
by jdv (216.16.224.222) (jdv@clevermonkey.org) on Mon Apr 28 13:50:05 2014 (GMT)
http://clvrmnky.org/
  > mandoc(1) is not a replacement for man(1), but for "groff -mandoc"; see man.conf(5) to learn how man(1) uses it. There isn't much of a roadmap regarding plain mandoc(1), i mostly completed that work three years ago. Oh well, i still have some ideas, yeah...
>
> There is no need to change any muscle memory. man(1) invokes mandoc(1) and apropos(1) as needed by default. For example, "man -k An=Gray -a Xr=pci" works just fine and does the same as "apropos An=Gray -a Xr=pci".
>
> Your questions are a bit basic to find answers in my slides; i didn't even explain much of what you are asking in my first talk three years ago: http://www.bsdcan.org/2011/schedule/events/230.en.html
> http://www.openbsd.org/papers/bsdcan11-mandoc-openbsd.html

Actually, this was the hint I needed. Seeing how we got to here from there is the best way I could grok this.

I'm not a manual producer, but a manual consumer. So now I know better where this fits in that relationship. This was my guess, but I am ignorant of most aspects of the manual producer end (I fuzzily know that tbl, groff, etc. are invoked at various times to read various formats of files to mumble mumble mumble).

For now, I'm good. But I see that I will have to pay closer attention if I ever get around to the little port I want to do.

  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (64.145.76.181) on Thu Jul 13 15:50:30 2017 (GMT)
  Dofollow Trust Flow Backlinks
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (45.116.232.20) on Thu Jul 13 21:42:38 2017 (GMT)
  Yeah, I love the way this post has been written. The way it has been written here has given me the help in writing your academic paper that I needed and I could not be more happy about that.
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (209.107.204.143) on Tue Aug 1 13:03:41 2017 (GMT)
  Make the most of mainly premium substances - you will find him or her for: Questions to ask
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (64.145.79.244) on Tue Aug 1 20:45:14 2017 (GMT)
  Very good topic, similar texts are I do not know if they are as good as your work out. Healthy Snacks
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (64.145.79.244) on Tue Aug 1 20:51:47 2017 (GMT)
  I recommend only good and reliable information, so see it: Apple Cider Vinegar
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (45.116.232.37) on Tue Aug 8 23:42:01 2017 (GMT)
  It's superior, however , check out material at the street address. vinkit pillun nuolemiseen
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (45.116.232.20) on Wed Aug 9 12:58:39 2017 (GMT)
  Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing... houses in shanghai
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (45.116.233.51) on Sun Aug 13 16:55:57 2017 (GMT)
  I also wrote an article on a similar subject will find it at write what you think. voyance tarot
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (43.230.95.181) on Sat Aug 19 20:29:39 2017 (GMT)
  Excellent read, Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. hamstring stretches
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (43.230.95.181) on Sat Aug 19 20:45:29 2017 (GMT)
  I invite you to the page where see how much we have in common. cable rows
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (43.230.95.181) on Sat Aug 19 21:28:26 2017 (GMT)
  I use basically superior fabrics : you will discover these products by: healthiest protein bars
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

  Re: Faster and more capable whatis(1)/apropos(1) (mod 0/0)
by ali (43.230.95.181) on Sat Aug 19 21:34:24 2017 (GMT)
  On that website page, you'll see your description, why not read through this. one rep max calculator
  [ Show thread ] [ Reply to this comment ] [ Mod Up ] [ Mod Down ]

[ Home | Add Story | Archives | Polls | About ]

Copyright © 2004-2008 Daniel Hartmeier. 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 deadly.org with Jose's and Jim's kind permission. Some icons from slashdot.org used with permission from Kathleen. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. Search engine is ht://Dig. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]