Creating Manpages with groff

A Call for New Manpages!

Article from Issue 51/2005

Do have difficulty remembering

command syntax? It often pays to

check the manpage. In this issue of

Command Line,we look at how to

create your own manpages,and

how to convert manpages to other


Good documentation is almost as

important as good programming.

It even makes sense to document

the major functions in the most trivial of

your own scripts, to save you from racking

your brains later when you need to

change something. Manpages give users

tips on usage and details on command

syntax options. Some manpages also

include examples or references to related


Users can read manpages in a terminal

window, and they can convert a manpage

quickly and easily to another

format such as HTML, PostScript, or

PDF. Manual pages are traditionally created

using the text formating tool groff.

The first version of this program

appeared on legacy Unix systems, where

it was known as roff (= “run off”). Later

developments of the document formatter

were called nroff and troff; groff is the

GNU version for the current crop of

Linux systems. This article shows how to

use groff to write a manpage and how to

convert that manpage into other formats.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Admin Workshop: Documentation

    System admins routinely refer to documentation for help with obscure command line options. In this month’s Admin Workshop, we examine the programs and formats behind the command line documentation you read everyday.

  • Fish Shell

    The Fish shell offers some user-friendly features for command line beginners.

  • Command Line

    This month, we’ll show you how to decorate your console and give it a fresh new look by adding color to the command line with ANSI escape sequences.

  • navi

    When the history function fails and the manpage is too long, navi comes to the rescue with an interactive cheat sheet for the shell.

  • Systemd Timers

    Systemd can start timers that automatically perform tasks at specified times. The configuration files are known as timer units.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More