Score:0

How to determine the location of the main man page directory

mm flag

I have an install script for a little program (script) that comes with man pages.

How can I find the location (full path) of the main man page directory?

As manpath gives me a list of directories, I would like a command to get a single directory and in best case the main one in order to copy man-files there.

pLumo avatar
in flag
manpages' main directory is always `/usr/share/man` as defined by the [Filesystem Hierarchy Standard](https://www.pathname.com/fhs/pub/fhs-2.3.html#USRSHAREMANMANUALPAGES).
mm flag
So I can install to /usr/share/man/man1 ? There are no files in /usr/share/man itself.
pLumo avatar
in flag
yes `man1` is correct, it's in the link directly below.
Score:1
cn flag

The man command itself can show the location of a man page with the -w and the -W options.

Here's an excerpt of man's man from Ubuntu 16.04:

       -w, --where, --path, --location
              Don't actually display the manual pages, but do print the location(s) of the  source  nroff  files
              that would be formatted.

       -W, --where-cat, --location-cat
              Don't  actually display the manual pages, but do print the location(s) of the cat files that would
              be displayed.  If -w and -W are both specified, print both separated by a space.
Score:1
in flag

Filesystem Hierarchy Standard stated that Manual pages are stored in <mandir>/<locale>/man<section>/<arch> With <mandir> usually be /usr/share/man, and the man<section> that fits best with your case is man1: man1: User programs Manual pages that describe publicly accessible commands are contained in this chapter. Most program documentation that a user will need to use is located here. Other attributes in the path can be found in the standard.

So yes, you can save your man files straight in /usr/share/man/man1, but try to save it in a more specific path to comply with the standard and to, quote from above standard link, "support manual pages which are written in different (or multiple) languages. These provisions must take into account the storage and reference of these manual pages. Relevant factors include language (including geographical-based differences), and character code set".

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.