LinuxCommandLibrary

colcrt

Filter out reverse line feeds

SYNOPSIS

colcrt [-2] [-] [file ...]

PARAMETERS

-2
    Formats output into two columns per page (similar to pr -2).

-
    Suppresses terminal initialization and termination sequences.

DESCRIPTION

colcrt is a Unix filter utility that processes nroff output to make it suitable for display on CRT terminals, which lack support for reverse line feeds used in underlining or bolding. It converts backspace sequences (^H) into visible effects: overstruck characters are typically rendered by repeating the prominent character or using underlines.

Key functions include expanding tabs to spaces, inserting carriage returns for line printers, and emulating old CRT plotter behavior. Input is read from standard input or files; output goes to stdout.

For instance, a sequence like a^H_ (a backspaced over _) becomes an underlined a, while bold might repeat characters. This allows previewing formatted man pages or troff/nroff documents on terminals before printing.

The tool is simple yet effective for legacy text processing workflows. Use it in pipelines like nroff -man file.1 | colcrt. Modern terminals and pagers (less, more) often handle such output natively, reducing its necessity today.

Limitations stem from its age: it assumes 7-bit ASCII and basic overstriking, not handling colors, Unicode, or complex formatting.

CAVEATS

colcrt is obsolete for modern use; assumes ASCII, mishandles UTF-8/Unicode. Use grotty or pagers with escape support instead.

TYPICAL USAGE

man ls | col -b | nroff -man | colcrt
Preview man page with underlining on CRT-like display.

HISTORY

Originated in early BSD Unix (pre-4.3BSD, circa 1980s) as part of text formatting tools for troff/nroff. Maintained in util-linux and FreeBSD; largely unchanged since.

SEE ALSO

col(1), nroff(1), pr(1), groff(1)

Copied to clipboard