How to view man pages in a web browser?

by boehj   Last Updated October 19, 2019 21:12 PM

Which .conf file do I need to edit in order to view man pages in a web browser? I'd like to use Google Chrome to do this.

Is this possible?



Answers 3


One way to do this is to put the following command in ~/.profile:

export PAGER="col -b  | open -a /Applications/Safari.app -f"

The PAGER environmental variable controls what program man uses to display man pages. the col command removes all of the backspace-formatting from the man page. The open command saves the output as a temporary text file and opens it with Safari.app.

Or you can edit the PAGER variable in /private/etc/man.conf. You could also probably edit the NROFF variable and eliminate the need to use col -b. See the man page for man.conf.

Nathan Grigg
Nathan Grigg
May 20, 2011 20:19 PM

You can add a function to your ~/.bash_profile:

function gman () {
     man "$1" | col -b > "/tmp/$1"
     open -a "/Applications/Google Chrome.app" "/tmp/$1"
}
Graham
Graham
May 20, 2011 23:31 PM

http://www.bruji.com/bwana/ is exactly what you're looking for.

Harv
Harv
May 21, 2011 01:56 AM

Related Questions


Updated February 28, 2018 04:12 AM

Updated November 16, 2017 01:12 AM

Updated December 24, 2017 09:12 AM

Updated August 23, 2017 15:12 PM

Updated March 07, 2018 18:12 PM