Linux Blog

A Manpage Template for your Scripts

Filed under: Shell Script Sundays — at 11:44 am on Sunday, June 21, 2009

So, you just finished that killer script and the first thing you want to do is write that man page for it right? Not exactly? What do you mean?
Writing a man page isn’t that hard and will give your users an idea of how to use a script.

Here is a basic template for creating your own man pages:

.\" This is a comment
.\" Contact
.TH man 1 "21 June 2009" ".1" "Man Page Example"
Man \- Example Man Page
Example Man Page
This is an example of a man page.
No options for this man page
man(1), groff(1), man.config(5)
No known bugs for this template, except you might want to replace the quotes if you copy from my blog.
Owen (

When you’re done with the gruelling task of writing documentation (which your users won’t read or thank you for) just plop it the correct man section in /usr/share/man
That’s all there is to it!