Manual Pages: Online Documentation

Many system administrators under utilize the capabilities used to search for and locate information about UNIX commands. As a result, they miss out on some of the commands available to them, or they don’t know about the options available with some of the more common commands. This section describes the methods that can be used to locate and display information about commands. This information will help you to be more productive.

The online documentation provided for each UNIX command is referred to as the system’s “manual pages,” or “man pages” for short. The man command displays information from the man pages, which are very useful if you know which command you want to use but forgot how to use it.

Because the documentation tends to be difficult to read for a new user, man pages are most helpful if you already understand what the command does but just need a quick review of the syntax and options. You’ll find that if a command or utility is new to you, you’d probably be better off consulting this book; it will be much easier for you to understand. Man pages provide little or no examples, and the description of the commands and options can be vague at times. If, however, you don’t carry this book with you everywhere you go, the man pages can provide a good secondary source of information.

To view the man pages for a particular command, type man followed by the command, as follows:

man ls <cr> 

In this example, the system will display all of the online documentation for the ls command, as shown in Figure 1.1.

Figure 1.1. The man page for the ls command.


The man page usually starts with a brief description of the command, followed by the command syntax that must be used, followed by a detailed description of the command. Options that are used with the command are described next, followed by examples (if there are any), special notes about the command, and finally a listing of other related commands.

The man page documentation is automatically piped to the more command to display one screen of information at a time. Press the spacebar to view the next page or Return to scroll one line at a time. Type h while viewing the man page to display a menu of additional commands that can be used to navigate the man pages.

Man pages are stored in the /usr/share/man directory with a subdirectory for each section of the manual. Because these directories are optionally installed, they might not reside on your host and might need to be installed from the installation CD-ROM (see Chapter 12, “Software Package Administration”). Table 1.1 describes the sections of the man pages that are available in the standard distribution of the operating system. Most of these sections also contain subsections. Additional man pages might be installed as you load other unbundled software packages.

Table 1.1. Standard Man Page Sections
Section Description
1 User commands
1B Commands found only in the SunOS/BSD Compatibility Package
1C Commands for communicating with other systems
1F Commands associated with Form and Menu Language Interpreter (FMLI)
1S Commands specific to the SunOS system
1M Manual for system maintenance commands
2 Information on system calls and error numbers
3 Information on functions and libraries
4 Information on file formats
5 Descriptions of publicly available files and miscellaneous information pages (for example, standards, environments, man page macros)
6 Documentation for computer demos and games.
7 Documentation on special files (for example, hardware devices)
8 Not used
9 Documentation on device driver interfaces

If you can’t remember the command used to perform a particular task, you can use the man utility to search for it by keyword using the -k option to the man command, as follows:

man –k print <cr> 

Any command that contains the keyword print in its brief description will be listed, as shown in Figure 1.2.

Figure 1.2. The man –k listing for the print keyword.

The list will contain the command name, the section of the man page describing the command, and a brief description of the command.


Note

A Solaris command named apropos performs the same function as man –k.


You might receive the following error when using the -k option to search the man pages:

/usr/share/man/windex: No Such File Or Directory 

This error indicates that the windex database file for the man pages has not been created. The windex database is not created by default and must be created by the system administrator using the catman command. This command only needs to be run on the system once to create the windex database for each section of the man pages. To create the windex database, use the following command:

catman 1 2 3 <cr> 

This creates the windex database for sections 1, 2, and 3 of the man pages. Specify additional sections in the argument field to create the windex database for other sections of the man pages.

If you are using a bitmapped display, capable of displaying graphics, you can use the xman command to display man pages in a GUI. This interface provides a nice point-and-click interface to navigate through the man pages. From the command prompt, type the following:

xman 

The xman menu shown in Figure 1.3 will appear.

Figure 1.3. The xman menu.


If you click on the Manual Page button, the xman help screen shown in Figure 1.4 appears.

Figure 1.4. The xman help screen.


This help screen describes how to navigate the man pages using the GUI.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset