Creating a linux man page

Structure of a Man page

Header Name Synopsis Description Options Resources Diagnostics See also
Copyright Bugs Authors

mymanpage.1 —————————————————————

.TH MYMANPAGE 1

.SH NAME mymanpage \- A Demo

.SH SYNOPSIS .B mymanpage [\-option …]

.SH DESCRIPTION .PP \fImymanpage\fP is a complete application that does
nothing useful.

.PP It was written for demo

.SH OPTIONS .PP It doesn't have any, but let's pretend, to make this
template complete:

.TP .BI \-option If there was an option …

.SH RESOURCES .PP mymanpage uses almost no resources.

.SH DIAGNOSTICS The program should provide info about what it does

.SH SEE ALSO The only other program we know with this little
functionality is the hello world application.

.SH COPYRIGHT

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.

.SH BUGS There were a few bugs

.SH AUTHORS Raja AG

———————————————————–

After saving the file, type at the terminal: [root@AGRAJA~]#groff
-Tascii -man mymanpage.1

Installing the man page: [root@AGRAJA~]#gzip mymanpage.1
[root@AGRAJA~]#cp mymanpage.1.gz /usr/share/man/man1

Test the man page: [root@AGRAJA~]#man mymanpage

No comments:

Minmanpro

Follow Tags or Archives to navigate within this site. Blog entries are also available in printable format as Documents. Links direct to my online presence. Find interesting links from Feeds

HOME | BLOG