Open man pages in safari or other browsers in osx

This is an excellent tweak to make to your osx or linux system open man pages in safari (or firefox or chrome):

man pages are great, but they arent the most usable.
browsers are far more usable.

You can set an enviroment variable in your osx or linux system that will let your man pages be read in your browser of choice:

Open man pages in safari

In osx to read man pages in safari
open a terminal:

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

Open man pages in chrome

in osx to open man pages in google chrome:
open a terminal:

export PAGER="col -b | open -a /Applications/Google\ Chrome.app -f"

now when you run ‘man whatever’ in your terminal, the man page will open in your browser

there is also an app called bwana that you can install which allows you to get the manual pages by entering man://whatever in your url bar!

if you have bwana installed, then you can get bwana to open the man page in your browser when you type the man commands in the terminal too:

firstly open ~/.bash_profile in your text editor of choice
(if bash_profile doesnt exist, then you can create it [touch ~./bash_profile])

add the following alias to your bash profile:

function newman() { open -a /Applications/Safari.app man://$@ ;}
alias man='newman'

Save the file and close all open terminals. When you open a new command-line terminal and you type:

man bash

in the (new) terminal it will open the man page in safari using bwana!

Leave a Reply