I'll use a fictional man page for the mongrel command as an example of how to create man pages for your Linux system. First Let me show you The finished man page:
$ man mongrel
MONGREL(7) mongrel.20m.com MONGREL(7)
NAME
mongrel - worthless orphaned process with parents of mixed
origin.
SYNOPSIS
mongrel [OPTIONS] [PID]
DESCRIPTION
mongrel - create or interact with a worthless runaway pro-
cess PID.
The process can be captured in the dogpound daemon, or it
may be a stray process. The stray process may occasionally
show up on a potential parent processes doorstep where
with the right amount of coaxing will become a child to
the said process. If the stray process is allowed to run
free for to long it runs the chance of breeding with
another process, creating more mongrel processes.
OPTIONS
-f --feed
Feeding the stray process is usually the best way to
befriend and adopt it.
-c --chase
Chase the runaway process out of your sight.
-n --name=NAME
Call the process by NAME for future references. It
will not always respond the NAME you give it
-r --report
Report the process to the dogpound daemon for cap-
ture.
-C --Capture
Attempt to capture the mongrel yourself (be careful
this is a good way to get bit).
-f --fix
Spay or Neuter a captured mongrel so it can not spawn
and child processes.
-v --vaccinate
Vaccinate captured mongrel for infectious diseases
which may be dangerous to you or the stray process.
-w --worm
Treat process for internal parasites, increasing it's
health.
-t --train
Train mongrel process making it more obediant.
-s --school
Have a professional train process at a high cost.
Occasionally this has proven to be a waste of time.
WARNINGS
Be careful although a stray process can make a great,
loyal pet, many may be unpredictable. Some are wild, with
no fear of humans because of their domestic origins. Chil-
dren should be told never to pet a strange process.
Be advised that a stray process may carry disease. It is
best to leave the handling of stray processes to the dog-
pound daemon. Once captured and checked for and infectious
diseases you can still adopt a mongrel process if you so
desire. It is suggested that you always have all your pro-
cesses spayed or neutered to avoid unwanted processes.
AUTHOR
Written by Anthony Ventimiglia.
REPORTING BUGS
Report Bugs to <bugzilla@mongrel.20m.com>
COPYRIGHT
Copyright C 2001 by MultiDogMediA. This is Free Software;
see source code for copying conditions. There is NO WAR-
RANTY.
SEE ALSO
Other Commands for handling a stray process: vaccinate(8),
dogpound(8), adopt(7), euthanize(8).
V 4.20 Sept 26 2001 1
Now here is the code that produced the mongrel man page, you can use any basic text editor (vi or emacs) to write this.
.\" Man page for fictional mongrel command .\" These first two lines are comments and will not be seen in the man page .TH MONGREL 7 "Sept 26 2001" "V 4.20" "mongrel.20m.com" .SH NAME mongrel \- worthless orphaned process with parents of mixed origin. .SH SYNOPSIS .B mongrel [\fIOPTIONS\fR] [\fIPID\fR] .SH DESCRIPTION .B mongrel creates or interact with a worthless runaway process .B PID. .PP The process can be captured in the .B dogpound daemon, or it may be a stray process. The stray process may occasionally show up on a potential parent processes doorstep where with the right amount of coaxing will become a child to the said process. If the stray process is allowed to run free for to long it runs the chance of breeding with another process, creating more .B mongrel processes. .SH OPTIONS .TP 5 .B \-f \-\-feed Feeding the stray process is usually the best way to befriend and adopt it. .TP .B \-c \-\-chase Chase the runaway process out of your sight. .TP .B \-n \-\-name=NAME Call the process by .B NAME for future references. It will not always respond the .B NAME you give it .TP .B \-r \-\-report Report the process to the .B dogpound daemon for capture. .TP .B \-C \-\-Capture Attempt to capture the mongrel yourself (be careful this is a good way to get bit). .TP .B \-f \-\-fix Spay or Neuter a captured mongrel so it can not spawn and child processes. .TP .B \-v \-\-vaccinate Vaccinate captured mongrel for infectious diseases which may be dangerous to you or the stray process. .TP .B \-w \-\-worm Treat process for internal parasites, increasing it's health. .TP .B \-t \-\-train Train \fBmongrel\fR process making it more obediant. .TP .B \-s \-\-school Have a professional train process at a high cost. Occasionally this has proven to be a waste of time. .SH WARNINGS Be careful although a stray process can make a great, loyal pet, many may be unpredictable. Some are wild, with no fear of humans because of their domestic origins. Children should be told never to pet a strange process. .PP Be advised that a stray process may carry disease. It is best to leave the handling of stray processes to the .B dogpound daemon. Once captured and checked for and infectious diseases you can still adopt a .B mongrel process if you so desire. It is suggested that you always have all your processes spayed or neutered to avoid unwanted processes. .SH AUTHOR Written by Anthony Ventimiglia. .SH REPORTING BUGS Report Bugs to <bugzilla@mongrel.20m.com> .SH COPYRIGHT Copyright C 2001 by MultiDogMediA. This is Free Software; see source code for copying conditions. There is NO WARRANTY. .SH SEE ALSO Other Commands for handling a stray process: \fBvaccinate(8)\fR, \fBdogpound(8)\fR, \fBadopt(7)\fR, \fBeuthanize(8)\fR. .br
Now I'll explain the groff man macros in the order they are used in the example man page.
There are additional tags which I didn't use in this example. Here they are:
Well that should get you started making man pages, next I'll get in to installing your local man pages into your directory structure so your pages will be accessible through the man and apropos commands.