Create a man page

This little exercise is to create a man page.  The goal is to take a simple online man page that is in XML and copy into a text file.  Add a couple of markups here and there, test, and validate it.

Create a manpage

Additional examples and options are available on the author’s site, here.  I took that html page and created a man page for the utility.  Another first, and it turns out to be quite easy.  I may not have completely followed all the conventions, but this is what I did.


Using the vim editor, I copied and pasted the online man page into a text file, ie  I added the markups .TH and .SH throughout the document. Use gzip to zip the file and move the file to an appropriate place.  I elected to move my man page to an already existing location, alternately the recommendation from some sources is /usr/local/man directory.  It’s not perfect, but near perfect.  Again the first time.

mv /usr/share/man/man1/
man shc

To view the man pages with color (where enabled), install most.

yum install most
echo 'export PAGER="most"' > /etc/profile.d/

There is a cool utility to list the location of the man pages.


One more step to make sure that the man page passes the proper design and to add it to the whatis database.

whatis shc

The expected result.