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.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>