Search code examples
linuxbashshellmanpage

Where should my Man script be located for it to work?


I'm trying to create a man script with out any success. Where in my files should I be placing my testScript.1 file for it to work visually as a man page?

So far I've tried by storing it just within two newly created directories in my home directory like so:

~/lab2/man1/testScript.1

I've also tried compressing the testScript.1 file into a tar.xz file and manually moving it to /usr/share/man/man1 with the file manager, but permission seems to be denied for some reason.

Also, when I try:

man testscript

the only result is: "No manual entry for testscript"

Where should it be located and how do I get it in there when "permission is denied" Thanks


Solution

  • You can either put your manual pages in the shared location (and you need root privileges for that) or store them wherever you want and tell man to use that folder.

    From man man page:

       -M  path
              Specify the list of directories to search for man pages.  Separate the directories with colons.  An empty list is the same as not specifying -M at all.  See SEARCH PATH FOR MANUAL PAGES.