Want to see manual pages from Terminal in PDF format?
Want to see manual pages from Terminal in PDF format?
- Subject: Want to see manual pages from Terminal in PDF format?
- From: Corey Carson <email@hidden>
- Date: Wed, 08 Apr 2009 09:54:15 -0600
This is always worth revisiting, as it's a cool Mac trick for those of
you that spend any time at all using the command line interface. Often
times, users have to read a manpage about a tool they're using in
Terminal. For example, if I want to see all of the variables and
options within the dsconfigad command, I would type "man dsconfigad"
in Terminal and it would show me just that. The problem, however, is
that you can't do anything with it short of copying and pasting each
section of text into another application so that you can easily
reference it later. Searching the document would also be nice. Here's
where manpage shines.
In the root of your home directory, create the .bash_profile. In
Terminal, type:
touch .bash_profile
Then, use pico or vi to edit that file by typing:
pico .bash_profile
Copy/paste this text (without the --- at the top and bottom).
---
function manpage {
tmpfile="/tmp/man ${*}.pdf"
if [ \! -f "${tmpfile}" ]
then
man -t "${*}" | pstopdf -i -o "${tmpfile}"
fi
open "${tmpfile}"
}
---
Quit and save the document. The pico commands for doing so are at the
bottom of the Terminal window. Restart Terminal and type "manpage
dsconfigad" and see the PDF (without the quotes).
Enjoy,
Corey
----------------
Corey Carson
Systems Engineer
Apple - Higher Education
Colorado, Wyoming and Montana
303.378.7193
800.800.2775 (Tier 1 Tech Support)
800.752.7753 (Tier 2 & 3 Tech Support)
Rockies-edu listserve:
http://lists.apple.com/mailman/listinfo/rockies-edu/
----------------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Rockies-edu mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden