Previous Table of Contents Next


Module 155
whatis (BSD)

DESCRIPTION

The external whatis command displays the header line of a given command's man page. The header line contains the name of the command, the section of the reference manual it resides in, and a brief description of the command.

The format of the output is command(N) description, where N is the section number. Once the name and section have been returned you can run the man command to display the entire man page for a specific command. The format of the man command is man section command.

Actually whatis is the same as the man -f command.

You must know the name of a command to utilize whatis. If you do not know the name of the command, try the apropos command.

COMMAND FORMAT

Following is the general format of the whatis command.

     whatis command ...

Arguments

The following argument may be passed to the whatis command.

command The name of the command you want described. You must know the name of a command to use whatis.

RELATED COMMANDS

Refer to the apropos and man commands described in modules 5 and 87.

RELATED FILES

The whatis command looks for header lines in the /usr/man/whatis database file. Your system administrator can create this file by executing the /usr/lib/mkwhatis or the /usr/lib/makewhatis command while logged in as super-user.

APPLICATIONS

The whatis command is helpful in deciding whether a command performs the function you think it may perform. One of the problems with whatis is the inconsistent format and wording of UNIX man pages and their headers. The whatis command displays the header line, but the header line may be misleading to you. Thus it may be difficult to trace the exact command you want to use.


TIP:  The word "print" is often used in header lines of man pages to say that the command displays text to the standard output. This is often misleading, since you may think of "print" as sending output to a printer.


TYPICAL OPERATION

In this activity you use the whatis command to display the header line of the vi and cat. Begin at the shell prompt.

1.  Type whatis vi and press Return. The output resembles this:
   cj> whatis vi
   vi(1) - screen oriented (visual) display editor based on ex
2.  Type whatis cat and press Return. The output looks like this:
   cj> whatis cat
   cat(1) - catenate and print

Notice the difference between the two descriptions. The vi one is fairly concise and explanatory, but the cat one is vague, if not useless.
3.  Turn to Module 87 to continue the learning sequence.


Previous Table of Contents Next