我最近决定,因为我经常尝试使用最新版本的nmap
,所以最好在~/.nmap
中保留其SVN结帐,而无需安装,只需运行svn up; make
让它更新。我向~/.nmap
添加了$PATH
,我意识到通过此设置,我无法再运行man nmap
了。我读了$MANPATH
并意识到这对我来说似乎不起作用:
[14:51:28][~/.nmap]$ manpath
manpath: warning: $MANPATH set, prepending /etc/man_db.conf
/home/d/virtualenv/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man:/home/d/.nmap/docs/man-xlate/:/home/d/.nmap/docs
[14:51:32][~/.nmap]$ strace man 1 nmap 2>&1 | egrep 'nmap.1|write'
stat("/home/d/.nmap/docs/zenmap.1", {st_mode=S_IFREG|0664, st_size=5943, ...}) = 0
stat("/home/d/.nmap/docs/nmap.1", {st_mode=S_IFREG|0664, st_size=183621, ...}) = 0
access("/usr/share/man/man1/nmap.1.gz", R_OK) = -1 ENOENT (No such file or directory)
write(2, "No manual entry for nmap in sect"..., 38No manual entry for nmap in section 1
为什么会这样,我该如何解决?我注意到man
也在index.db
中查找名为~/.nmap/docs
的文件但无法找到它,也许这是一个线索?
答案 0 :(得分:1)
问题是docs目录没有man要求的目录结构(nmap.1
应该在man1
子目录中),与使用-M
选项时相同:
-M path, --manpath=path
Specify an alternate manpath to use. By default, man uses
manpath derived code to determine the path to search. This
option overrides the $MANPATH environment variable and
causes option -m to be ignored.
A path specified as a manpath must be the root of a manual
page hierarchy structured into sections as described in the
man-db manual (under "The manual page system"). To view
manual pages outside such hierarchies, see the -l option.
使用make install
时,联机帮助页已安装到正确的类别子目录中。所以将MANPATH
指向docs目录直接无法工作。