Forrest logo
back to the troff tool

troff:tldr:7cd4c

troff: Format output for a PostScript printer, saving the output to a file.
$ troff ${path-to-input-roff} | grops > ${path-to-output-ps}
try on your machine

This command uses two Unix/Linux utilities, namely "troff" and "grops", to convert a roff file (input) into a PostScript file (output). Here's a breakdown of the command:

  1. troff: It is a text formatting command used to process roff (short for "runoff") files. Roff is a markup language used for document formatting and typesetting. When given the path to the input roff file (specified by ${path-to-input-roff}), troff reads and interprets the roff document.

  2. ${path-to-input-roff}: It denotes the path to the input roff file. This needs to be replaced with the actual file path in the command.

  3. |: This is the pipe symbol, which is used to redirect the output of one command to another as input. In this case, the output of the troff command will serve as the input for the next command.

  4. grops: It is another command in Unix/Linux used to convert troff output into PostScript (PS) format. grops reads the troff output from the previous command through the pipe, processes it, and generates a PostScript version of the formatted document.

  5. ${path-to-output-ps}: It represents the path to the output PostScript file. This needs to be replaced with the desired file path where the PS file will be created.

In summary, the command takes a roff file as input, processes it using the troff command, and then converts the output into a PostScript file using the grops command. The resulting PostScript file is saved at the specified path.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the troff tool