WHICHMAN(1)

πŸ’– WHICHMAN(1) πŸ’–

okay so bestie, welcome to the whichman manual page, from the General Commands Manual section, and it's giving "which but make it generous" πŸ’…


✨ NAME ✨

whichman β€” shows you where a man page lives, using a fault tolerant approximate matching algorithm 🌸


πŸŽ€ SYNOPSIS πŸŽ€

whichman [-#ehIp][-t#] man-page-name

πŸ¦‹ DESCRIPTION πŸ¦‹

So whichman is like a which-alike search command, but for man pages πŸ‘‘ It goes digging through the MANPATH environment variable.

If that variable isn't set at all? No stress, it just uses this default and moves on:

/usr/share/man:/usr/man:/usr/X11R6/man:/usr/local/share/man:/usr/local/man

Now here's the tea: unlike which, this program does not stop at the first match 🫢 It literally does not. And honestly the name should probably have been something like whereman, because it's not a "which" at all, bestie, it's a whole different vibe 😭 whichman shows you all the man pages that match, and it lets you figure out which sections those pages belong to.

Also β€” and this is lowkey iconic β€” whichman can handle international manpage path names for different languages. Man pages in different languages may be stored in:

.../man/<country_code>/man[1-9]/...

By default, whichman does fault tolerant approximate string matching ✨ With a default tolerance level of:

(strlen(searchpattern) - number of wildcards)/6 + 1

no cap, that's the actual formula 🌈


πŸ’… OPTIONS πŸ’…

  • -h β€” prints a little help/usage information. your girl just wants to be helpful πŸ₯Ί
  • -I β€” do a case sensitive search (the default is case in-sensitive, so this is the spicy one πŸ”₯)
  • -e β€” use exact matching when searching for a given man page, and the wildcards * and ? get disabled πŸ’€
  • -p β€” prints the actual tolerance level right in front of the man page name πŸ“
  • -# or -t# β€” sets the fault tolerance level to #. The fault tolerance level is an integer # in the range 0-255. It says the maximum number of errors allowed while finding the approximate match. A tolerance_level of zero allows exact matches only β€” but it does NOT disable the wildcards * and ? ⚠️ (important distinction, bestie, don't get it twisted)

The search key may contain the wildcards * and ? (but like, peep the -e option first πŸ‘€):

  • '*' β€” any arbitrary number of character
  • '?' β€” one character

The last argument to whichman is not parsed for options, because the program needs at least one man-page-name argument. Which means:

whichman -x

will not complain about a wrong option β€” it will just search for the man page named -x 😌 periodt.


🌟 EXAMPLE 🌟

whichman print

This will e.g. find the man-pages:

/usr/share/man/man1/printf.1.gz
/usr/share/man/man3/printf.3.gz
/usr/share/man/man3/rint.3.gz

look at that, three results, she ate πŸ“


πŸ’€ BUGS πŸ’€

The wildcards '?' and '*' can not be escaped. These characters function always as wildcards. This is however not a big problem, since there is hardly any man page that has these characters in its name πŸ™ˆ so like... it's fine, honestly.


πŸ‘‘ AUTHOR πŸ‘‘

Guido Socher (guido@linuxfocus.org)


🌈 SEE ALSO 🌈

ftff(1), man(1)


and that's the whole page, bestie!! this one came out of the Search utilities corner of the world, dated April 1998 β€” yeah, she's vintage, she's a classic, and she still slays πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from