如何找到手册页源的位置?

gbo*_*ffi 1 man files

我想将*roff 格式的原始手册页通过pandoc管道传输到 PDF 并在文档查看器中显示,例如,

\n
$ my_script vim\n...\n
Run Code Online (Sandbox Code Playgroud)\n

有一个新窗口显示格式化的手册页。

\n

我的写作没有其他问题my_script,大部分内容是这样的

\n
zcat /???/vim.?.gz | pandoc -f man -t pdf | okular -\n
Run Code Online (Sandbox Code Playgroud)\n

但我不知道如何找到 vim 手册页的 *roff 源代码的确切位置,除了它位于$MANPATH.

\n

我知道某些命令有多个手册页,因此我想知道如何检索手册页源的第一个位置。

\n

wal*_*tor 7

通过阅读man man,您将看到man-w选项:

-w, --where, --path, --location
       Don't actually display the manual page, but do print the
       location of the source nroff file that would be formatted.
       If the -a option is also used, then print the locations of
       all source files that match the search criteria.
Run Code Online (Sandbox Code Playgroud)