colcrt
Filter out reverse line feeds
SYNOPSIS
colcrt [ - ] [ -2 ] [ file ... ]
PARAMETERS
-
Suppresses underlining. Useful when the output is intended for a device that can handle boldfacing properly but not underlining.
-2
Causes colcrt to output all half-lines, even if they are backspaced over. Normally, colcrt eliminates half-lines used for underlining and boldfacing, but this option preserves them for other purposes. Useful for outputting double spaced documents to a line printer.
file ...
One or more files to be processed. If no files are specified, colcrt reads from standard input.
DESCRIPTION
The colcrt command filters output from troff to allow underlining and overstriking (e.g., for boldface) to be rendered reasonably on a line printer or terminal. It removes reverse line feeds and converts half-line motions to full-line motions, producing a simplified output suitable for older printers.
Specifically, colcrt handles underlining by printing the character, then backspacing and printing the underscore. Boldface is handled by printing the character multiple times. It handles multiple columns and can be used to pre-process documents before printing or displaying them on devices lacking sophisticated formatting capabilities. colcrt is often used in conjunction with man pages to improve readability on text-based terminals. It is less relevant today due to the prevalence of more advanced display technology.
CAVEATS
colcrt does not handle all troff constructs perfectly. Complex formatting may not be rendered accurately. It is primarily designed for simple underlining and boldfacing. Modern terminal emulators and printers generally handle troff output natively, making colcrt less frequently needed.
EXAMPLE
To process a troff file and print the output:
troff -man manpage.1 | colcrt | lp
This command processes the manpage.1 file using troff with the -man option (for man page formatting), pipes the output to colcrt to prepare it for a line printer, and then pipes the result to the lp command for printing.
HISTORY
colcrt was a common utility in early Unix systems. It was designed to address the limitations of line printers and character-based terminals in rendering text formatted by troff and nroff. As printing and display technologies improved, its relevance has decreased, although it remains available in many Unix-like systems for compatibility.