Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts in Shell

Formatting text for printing

shellJan 6, 2007 1 min read

I periodically need to format text data on my Linux desktop for printing, and have always gone about this in one of two ways. If I want to add margins and make the data conform to a specific page length, I use the pr utility. Here is an example that formats FILE with a #4 margin, a #72 width (the default), and a length of 60 lines: If I have a text document that I want to format to 80-characters per line, I typically use fmt with the width option. The following example will force all lines to 80 characters, and will gracefully wrap lines if they exceed this limit: If you have any other methods for formatting text, I would love to hear them.

$ read more →