View man documentation in Preview

If you are on OSX you can easily open man documentation using Preview. Just replace ls with command you would like to see documentation for.

 man -t "ls" | open -f -a /Applications/Preview.app/

If you plan to do this often, you can make your life much easier by putting this inside your .bash_profile.

 pman ()
 {
   man -t "${1}" | open -f -a /Applications/Preview.app/
 }

Now you can use following to view documentation in Preview

 
 pman ls

Credit goes to John W. Long.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s