| MANPATH(5) | /etc/manpath.config | MANPATH(5) |
manpath - 格式化 /etc/manpath.config 文件
manpath 配置文件是手册页工具程序用来在运行时访问用户的 manpath 的。它指示了哪些手册页层次结构(manpath)应视为系统层次结构,并向它们分配用于保存 cat 文件的目录。
如果已经设置了环境变量 $MANPATH,/etc/manpath.config 中包含的信息不会覆盖它。
默认情况下,man-db 检查用户的 $PATH。对每个找到的 path_element,它会将 manpath_element 添加至搜索路径。
如果对于一个给定的 path_element 在配置文件中不存在对应的 MANPATH_MAP 行,则它将添加 path_element/../man、path_element/man、path_element/../share/man 和 path_element/share/man 这些路径中所有存在的目录至搜索路径中。
在此之后,它将添加配置文件中所有的 MANDATORY_MANPATH 条目至搜索路径中。
Finally, if the --systems option is used or the $SYSTEM environment variable is set, then that should consist of a sequence of operating system names separated by commas or colons. This acts as a template, expanding the search path once more to allow access to other operating systems' manual pages: for each system name, man-db looks for that name as a subdirectory of each entry in the search path, and adds it to the final search path if it exists. A system name of man inserts the normal search path without subdirectories. For example, if the search path would otherwise have been /usr/share/man:/usr/local/man, and $SYSTEM is set to newOS:man, then the final search path will be /usr/share/man/newOS:/usr/share/man:/usr/local/man/newOS:/usr/local/man.
$MANPATH 环境变量会覆盖 man-db 的默认手册页搜索路径。大部分用户不应该需要对此进行设置。其语法类似 $PATH 环境变量:它包含一个目录名称的序列,并使用冒号进行分隔。它会覆盖上文所述的默认搜索路径。
如果 $MANPATH 使用冒号开头,则默认搜索路径将添加到其开头位置。如果 $MANPATH 使用冒号结尾,则默认搜索路径将添加到其结束位置。如果变量的值包含双冒号(::),则默认搜索路径将插入到两个冒号之间。
当前支持以下字段类型:
系统手册页层次结构通常保存在 /usr 下,如 /usr/man, /usr/local/man 和 /usr/X11R6/man。
如果来自某个特定 manpath_element 的 cat 页面不保存,或保存在传统位置,可以忽略 catpath_element。
传统的 cat 保存位置无法处理只读方式挂臷的手册页层次结构,因此(考虑到这种情况),可以指定任何有效的目录层次结构来存储 cat。要观察 Linux FSSTND,可以在实际目录的位置使用关键词“FSSTND”。
不幸的是,需要指定 所有 系统 man 目录树的路径,包括替代的操作系统路径,如 /usr/man/sun 和任何的 NLS 区域语言 路径,如 /usr/man/de_DE.88591。
由于是按写的顺序逐行解析的,因此必须先列出作为另一层次结构的次级结构的 manpath,否则会出现不正确的匹配。例如,/usr/man/de_DE.88591 应出现在 /usr/man 之前。
SECTION 1 n l 8 3 0 2 3type 5 4 9 6 7
如果给出了多个 SECTION 指令,它们的章节列表会被合并。
If a particular extension is not in this list (say, 1mh) it will be displayed with the rest of the section it belongs to. The effect of this is that you only need to explicitly list extensions if you want to force a particular order. Sections with extensions should usually be adjacent to their main section (e.g. "1 1mh 8 ...").
SECTIONS 是此指令的替代名称,也允许使用。
除非完全准确的遵守了这些规则,否则手册分页工具会工作不正常。这些规则过于复杂了。
https://gitlab.com/man-db/man-db/-/issues
https://savannah.nongnu.org/bugs/?group=man-db
| 2025-05-02 | 2.13.1 |