Skip to content

Instantly share code, notes, and snippets.

@amadamala
Created May 17, 2011 10:15
Show Gist options
  • Save amadamala/976237 to your computer and use it in GitHub Desktop.
Save amadamala/976237 to your computer and use it in GitHub Desktop.
Viewing man pages as pdf
# Add the following code to your ~/.bash_profile.
pman()
{
PMANFILE="/tmp/pman-${1}.pdf"
if [ ! -e $PMANFILE ]; then # only create if it doesn't already exist
man -t "${1}" | pstopdf -i -o "$PMANFILE"
fi
if [ -e $PMANFILE ]; then # in case create failed
open -a /Applications/Preview.app/ "$PMANFILE"
fi
}
# alias man = pman
# Restart terminal
# usage:
# man diff
# source http://www.mattryall.net/blog/2007/08/man-pages-pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment