News, info, and opinion by Mac users, for Mac users.

December 3, 2006

tips

Get a Preview of UNIX man pages

Posted Dec. 3, ’06, 9:25 AM PT by Dan Moren
Category | Tips

man PreviewI’m a Terminal geek, it’s true, but even I need to look things up from time to time. Command line programs are often pretty complicated, with a number of options that are hard to keep straight. Did I mean to run ps -aux or just ps -a? UNIX-derived systems like OS X’s command-line have a built-in system called man (short for “manual”) that let you look up any program. So, typing man ps will help me look up exactly which options do what for that command.

Reading man pages can be helpful, but they can also be frustrating. For one thing, reading them in the Terminal window is annoying, because you can’t search them easily, and it’s easy to get lost while paging up and down. Wouldn’t it be nice if you could read them in the comfort of a GUI application like Preview?

Rob “I put the ‘Term’ in ‘Terminator’” Griffiths offers this suggestion: add a special command to your shell which automatically opens a specified man page in Preview. The solution is a little long to go into here, but it’s easy enough to implement by following Rob’s directions. Then your man pages can bask in all their GUI glory.


2 Comments

Aughr said:

I don't know if you know this, but since man on OS X by default uses less as its pager, you can search by typing in / and then your search term.

Larry V said:

I'm sure that they know about the search, but still... it's a hell of a lot easier to read a PDF than screen after screen of Terminal text. I love this trick =)

Leave a comment

 




Visit other IDG sites: