Whatis

From LQWiki
Jump to navigation Jump to search

Whatis takes as its argument a command or other man page entry (such as for a function or system file) and searches the database of man page headers for it. A single line is printed out for each match. The printout will also contain the numbers of the sections in which they occur. You can then use the man command (with the section number if necessary for disambiguation) to display the page.

Whatis is very useful if you come across a command while browsing and just want a quick way to find out what it does without having to display a full man page.

e.g.

passwd (1) - change user password

passwd (5) - the password file

passwd [ssl_passwd] (1) - compute password hashes

This tells us immediately that passwd has three uses: it is a user command for changing one's password, the name of an important system file, and also a subcommand of openssl for hashing passwords. Any of these three man pages can then be read, if more information is required, by using the man command.

The database used by whatis is created by makewhatis.