makewhatis is run automatically during installation of the operating system. If man page are added subsequently, then an adminstrator should run it again to update the database files. Only root may use makewhatis. It always generates complete database files for all sections. It writes the database files to /usr/man/whatis and /usr/man/index.
makewhatis looks for man directories using MANPATH. See man(C) for details on MANPATH. If MANPATH is not specified as an environment variable when the command is run, then the default value is used from /usr/default/man. The man page directories must be subdirectories of an entry in the MANPATH value.
makewhatis can process man pages in several forms, including troff source, nroff-formatted pages, and HTML. Man page files compressed with compress(C), pack(C), gzip, and bzip2 can be handled as well.
The options to the command are:
Each entry in whatis consists of a line specifying a manual page name, its section, and a short description. Each type of manual page must be scanned for the information.
A troff source file must contain the following standard man key lines in this order:
.TH name section .SH NAME name \- single-line descriptionmakewhatis is flexible in what it will accept in the manual page source:
For HTML man pages, it will make use of the following meta tags embedded in the HEAD section of the HTML file:
<META name="manwhatis" content="name - description">The keyword
manwhatisidentifies that the line is for man page indexing, and the
contentattribute provides the name and description data to be indexed. Multiple meta tags can be included to provide multiple names and descriptions for a commands on a man page.
.TH makewhatis ADM .\" Note the mixed case of NAME below .SH NaMe .\" This comment line is ignored makewhatis \ add entries to the keyword database . . .This would produce the keyword database entry:
makewhatis (ADM) - add entries to the keyword database