ARCHIVED: In Unix, how can I print an nroff file?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Most nroff files use a macro package, such as the an package used for online manual pages. When you have an nroff file that you want to print, try to determine the macro package with which it was written. This information is often included in a README file along with the nroff file.

To format the document for printing, run it through nroff, specifying the macro package after the -m option, and pass the output to the print command. For example, you could print a manual page source on a BSD system with the following command:

  nroff -man filename | lpr -Pprinter_name

With System V, use the command:

  nroff -man filename | lp -d printer_name

In the above commands, replace filename with the name of the file you want to print, and printer_name with the name of the printer.

Another common macro package is the s package. If the document you have is not a manual page, you might want to try this option. To invoke it, add the -ms option on the command line.

At Indiana University, for personal or departmental Linux or Unix systems support, see Get help for Linux or Unix at IU.

This is document acoz in the Knowledge Base.
Last modified on 2018-01-18 09:19:04.