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.
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.man -k
on OpenBSD (which is using mandoc instead of mandb) is almost instant, even for nonexistant entries.