0

man-db's man --global-apropos/man -k is slow. man --global-apropos --where RestrictNamespaces takes around 30 seconds on a fairly beefy laptop with an NVMe. Compare to find $(manpath | tr : '\n') -type l -printf '%l\n' | xargs rg --files-with-matches --search-zip RestrictNamespaces, which produces identical results in less than 2 seconds.

Is there some way to search through the entire man DB at a speed comparable to combining five other CLI tools?

It looks like this exists on other platforms since at least eight years:

NetBSD has a full text search implementation of apropos(1) which does search across the complete content of man pages instead of restricting just to the NAME section.

Running mandb 2.12.1.

2
  • Which version of man-db are you using? -K performance was much improved in 2.10. I’m using 2.12 and I get results in around 1.5s. Commented Jun 26, 2024 at 14:32
  • man -k on OpenBSD (which is using mandoc instead of mandb) is almost instant, even for nonexistant entries. Commented Jul 19, 2024 at 9:10

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.