[ Team LiB ] Previous Section Next Section

Using Manual Pages

Manual pages are on-line technical references for each Solaris command. Manual pages are grouped into sections, with similar types of commands within the same section. For example, most user commands are in section (1), and system administration commands are in section (1M). Manual pages may be installed on a local system or NFS-mounted from a server. This section tells you how to display manual pages and how to find out the section numbers for an individual command.

Displaying a Manual Page (man)

To display a manual page, type man command-name and press Return. The manual page is displayed. The following example shows the beginning of the grep(1) manual page.


cinderella% man grep

grep(1)    USER COMMANDS    grep(1)

NAME
  grep - search a file for a pattern

SYNOPSIS
     grep   [   -bchilnsvw   ]  limited-regular-expression   [
(Additional lines deleted from this example)



Finding Manual Page Sections (man)

graphics/new.gif

The Solaris Operating Environment organizes commands by different sections. A section name consists of a major section name, typically a single digit, optionally followed by a subsection name, typically one or more letters. For example, the command lpr(1B) is in Section (1), User Commands, and belongs to the BSD Compatibility Package section. The major sections are listed in Table 25.

Table 25. The Major Manual Page Sections

Section

Description

1

User commands.

1M

System maintenance commands.

4

Information on file formats.

5

Descriptions of publicly available files and miscellaneous information pages.

6

Computer demonstrations.

Some commands are listed in more than one section. If you type the name of a command that is available in multiple sections, man displays the first manual page the system encounters in the first man section searched. You can find the section number(s) for a manual page with the whatis command. Then you can specify the section number as an argument to the man command so that you display the command from that specified section.

Creating Preformatted Manual Pages (catman)

graphics/new.gif

You can use the catman n command to create formatted manual pages, where n is the manual page section you want to format. Because catman makes the directories of preformatted manual pages self-contained and independent of the unformatted entries, you can easily distribute these preformatted manual pages among a group of associated systems. Running catman with no arguments reformats every manual page, which can be a lengthy procedure.

You can also use the catman -w option to create just the windex database file that is used by the whatis and apropos commands and the man -f and -k options.

Use the following steps to create or update the windex database file.

  1. Become superuser.

  2. Type catman -w and press Return.

    The windex database is created or updated.

Finding the Section Number for a Manual Page (whatis, man)

graphics/new.gif

Some commands are listed in more than one section. If you type the name of a command that is available in multiple sections, man displays the first manual page the system encounters in the first man section searched. You can find the section number(s) for a manual page with the whatis command. Then you can specify the section number as an argument to the man command so that you display the command from that specified section.

NOTE. The whatis command works only if you have first used the catman command to set up your manual pages. To use the catman command to set up manual pages, refer to "Creating Preformatted Manual Pages (catman)" on page 95.


Use the following steps to find the section number for a manual page.

  1. Type whatis command-name and press Return.

    The first line of the manual page for the command is displayed. Use the section number to display the manual page in the next step.

  2. Type man -s section-number command-name and press Return.

    The manual page is displayed.

The following example shows the four different chown manual pages and displays the manual page for the chown(2) command.


oak% whatis chown
chown   chown (1)     - change owner of file
chown   chown (1b)    - change owner
chown   chown (1m)    - change owner
chown   chown (2)     - change owner and group of a file
oak% man -s2 chown
chown(2)                SYSTEM CALLS               chown(2)

NAME
 chown, lchown, fchown  - change owner and group of a file

SYNOPSIS
 #include <unistd.h>
 #include <sys/types.h>

int chown(const char *path, uid_t owner, gid_t group);

int lchown(const char *path, uid_t owner, gid_t group);

int fchown(int fildes, uid_towner, gid_t group);


DESCRIPTION
chown() sets the owner ID and group ID of the file specified by path or
 referenced by the open file descriptor fields to owner and group
 respectively. If owner or group is specified as -1, chown() does not change
 the corresponding ID of the file.
(Additional lines deleted from this example)

graphics/new.gif

When the windex database is available, you can also use the man -k option to display the section number of a command. The following example shows the output of the man -k chown command.


mopoke% man -k chown
chown           chown (1)      - change file ownership
chown           chown (1b)     - change owner
chown           chown (1m)     - change owner
chown           chown (2)      - change owner and group of a file
fchown          chown (2)      - change owner and group of a file
fchownat        chown (2)      - change owner and group of a file
lchown          chown (2)      - change owner and group of a file
nischown        nischown (1)   - change the owner of a NIS+ object
mopoke%

graphics/new.gif

The apropos command also searches the windex database and does the same thing as the man -k command, as shown in the following example.


mopoke% apropos chown
chown           chown (1)      - change file ownership
chown           chown (1b)     - change owner
chown           chown (1m)     - change owner
chown           chown (2)      - change owner and group of a file
fchown          chown (2)      - change owner and group of a file
fchownat        chown (2)      - change owner and group of a file
lchown          chown (2)      - change owner and group of a file
nischown        nischown (1)   - change the owner of a NIS+ object
mopoke%



    [ Team LiB ] Previous Section Next Section