Mac OS X and Unix Tips

ziggy on 2005-05-15T19:34:50

When I installed Tiger, I backed up all of the old stuff of value onto DVD and wiped the hard drive. It's a good way to (a) get rid of unnecessary cruft that slowly accumulates over a couple of years and (b) make another attempt of logging what I install and modify to make a machine usable.

Of course, that means that I'll slowly discover all sorts of things that I used to have installed that have yet to be re-installed. Like Bwana, a little utility for formatting man pages within Safari.

Why did I need that? Because I was trying to keep a pretty version of man pr open in one window, and look at some tabular output in a shell window. Specifically, I was trying to remember how to format this command:

ls -1 ??????.html | sed -e 's/.html//'  | pr -11 -l1 -w80 
The magic incantation at the end of that pipe takes a list of a few hundred files, and formats them in 11 columns going across then down, using up as much of the 80 columns in my terminal window as necessary. ;-)

pr is one of those Unix commands I use every few years, to do that kind of tabular reformatting, but I can never remember the options I used last time I needed it. Which is why man pages are a good thing. ;-)