Originally Published: Friday, 6 April 2001 Author: Marc Baker
Published to: learn_articles_firststep/General Page: 1/1 - [Std View]

Getting Started with Man Pages

Ever wondered why the command to get help in Linux is 'man'? Well, wonder no more, as Marc Baker takes you through a manhunt to discover the benefits of free documentation.

Introduction

One area that Linux excels in is free documentation. Some documentation formats have already been written about on Linux.com such as: HOW-TOs, Guides and FAQ's. In this introductory article we will delve into the world of Man Pages.

What Are Man Pages?

Man Pages (short for manual pages) are a standard form of documentation found on most distributions of Linux and Unix. They are broken up into 9 sections as follows:

  1. Executable Programs or shell commands
  2. System Calls
  3. Library Calls
  4. Special Files
  5. File Formats and Conventions
  6. Games
  7. Macro Packages
  8. System Administration
  9. Kernel Routines

There are several excellent websites that have a subject index and allow you to search the man pages. One such site can be found at http://linux.ctyme.com.

Viewing Man Pages

Man Pages are viewed using the man utility. The basic format is man <topic>. Let's try this out. Open a Terminal Window and type man man at the command prompt. This will display the man page for the utility man. While viewing the page, SPACE moves down one page, ENTER moves down one line, 'b' moves back one page and 'q' quits.

If we take a look at the first screen, in the upper left hand corner we see the title of the page. Here we are viewing man(1). The number in the brackets represents the section where this man page resides, in this case section 1 - Executable Programs.

A manual page consists of several parts which may include NAME, SYNOPSIS, DESCRIPTION, OPTIONS, FILES, SEE ALSO, BUGS and AUTHOR. The SYNOPSIS section of this page can be intimidating. It lists all command line arguments available for the program in question, and rules governing how they can be used. Each available argument is explained in detail in the OPTIONS section. Read through the man page for man to get a feel for it then press 'q' to get back to the command line.

Some topics have two manual page entries. As an example, 'mount' is a command covered in Section 8, however, mount is also a system call covered in Section 2. In this case simply telling man what topic you want may not be enough. Don't fret though, you can tell man which section you want it to look in. Simply type man section topic (i.e. man 2 mount). This will let man know that you want the system call 'mount' man page.

Man Pages under X

We've discussed viewing man pages in a terminal window. There is a program called Xman that is included with the XFree86 distribution that gives you a graphical view of a man page. The GNOME Environment has their own man page viewer as well. It is aptly called gman and can be found at http://homex.coolconnect.com/user/xkwang/gman/. Gman and Xman allow you to browse all the man pages available on your system by category. People who have grown up under Windows environments may feel more comfortable here as you can navigate the page using your mouse.

Conclusion

Man Pages are able to deliver fast, detailed information on a large number of specific topics. Man Pages tend to be highly technical and sometimes it can be difficult to sift through and find what you need. This problem has been alleviated though with more user-friendly interfaces like Xman and the Internet. I encourage you to check out some of the Internet sites, being able to search the man page database is a very powerful tool. A search on http://www.google.com for 'man pages' will give you an excellent starting point (and even a site that teaches you to write your own manual page!).

Good Luck and Happy Manhunting.