16

Possible Duplicate:
How can I add man page entries for my own power tools?

Most (if not all) Linux commands have their man pages that describe their usage options etc. Can I create similar man page for my own bash scripts?

Slav Pilus
  • 171
  • 1
  • 1
  • 5

2 Answers2

16

Man pages are roff (see man 7 roff) formatted documents.

  • You can write it by hand.
  • You can use help2man to generate it from your script's help output.
  • You can write it in a markup language and use a dedicated tool to convert it to man:
manatwork
  • 30,549
  • 7
  • 101
  • 91
4

Yes, you can. The man pages are written as nroff files.
The /usr/local/man directory is the location typically used for any locally installed packages/files.
You can look at examples by looking at the existing manpages, (which will likely need to be uncompressed first), also read man.
Presently many users prefer groff to nroff, man groff to get started

bsd
  • 10,916
  • 4
  • 30
  • 38