10.5: View the new 'man' pages on upgraded systems

Dec 13, '07 07:30:03AM

Contributed by: matsw

In Leopard, many man pages (the documentation for Mac OS X's UNIX commands) are compressed with gzip. This is a very good idea but, if you upgraded to Leopard from Tiger, the old man pages are left in place by the installer (this is a bug).

So many man pages are there in two versions: the old uncompressed one from Tiger, and the new compressed one from Leopard. The problem is that when man searches for a given page, it finds the uncompressed one first and displays it, thus showing you outdated information. To solve the problem, the old man pages must be removed. I made a shell script that removes everything in /usr/share/man that is not installed by Leopard (I made the script by actually installing Leopard on a blank disk and comparing with my installed system). Here's the command to build the script:

for f in $(find /usr/share/man); do [ -e "/Volumes/Leopard$f" ] || echo rm "$f"; done >rm-old-man.sh
This command creates a shell script (in the directory from which it was run) containing rm commands for all man pages that are not in the Leopard clean install. You can then execute it by typing sudo sh rm-old-man.sh. If you want to try it, here's the script that I generated on my system [23KB download], which I think you can safely execute on any Leopard system. However, back up first -- you have been warned.

[robg adds: I haven't tested this one, nor can I confirm the issue, as my machines were all clean installs.]

Comments (27)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20071201021830891