Command-Line Invocation
nroff and troff are invoked from the command line as follows:
nroff [options] [files] troff [options] [files]
Although both formatters support a plethora of options, the following two are the most important for everyday use.
-
-mname Prepend a macro file to input files. Historically, one of
/usr/lib/tmac/tmac.name or/usr/share/lib/tmac/tmac.name were the locations of the macros for name. Solaris uses/usr/share/lib/tmac/name. GNU troff uses something like/usr/local/share/groff/x.y.z/tmac/name.tmac. The actual location and filename(s) vary among different Unix systems.-
-Tname Prepare output designed for printer or typesetter name. For device names, see your specific documentation or a local expert. GNU troff provides both PostScript and TEX DVI output.
Example
Format a manual page for printing using groff:
$ groff -man /usr/share/man/man1/awk.1 | lprBecome an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access