Formatting Text Files for Viewing and Printing in Linux

Filed under
HowTos

The commands offer ways to take plain text files and tidy them up or present them differently for display or printing.

The pr command takes a text file and splits it into pages of text separated by a number of newlines with a header on each page.

The fold command reformats a text file by breaking long lines.

The fmt command takes some text (say an article that you have written in a text editor) and does some sensible reformatting to it.

The a2ps command converts a text file to PostScript and either creates a file or sends it to the printer.

The enscript command does the same thing as a2ps.

Full Article.