Unix(Cygwin)whatis:返回所有命令为“无适当内容”

16

由于某种奇怪的原因,我的Unix shell(cygwin)中的“whatis”命令无法正常工作。 它不断返回“ls:nothing appropriate”或“cd:nothing appropriate”。 我想知道是否有一些设置出现错误。 有没有人可以提供帮助?谢谢!


1
type whatis 的输出是什么? - Deqing
它显示了“whatis被哈希了(usr/bin/whatis)”。 - Zhouster
6个回答

30

我在使用64位Red Hat Cygwin安装时遇到了类似的问题。

在我的情况下,/usr/sbin/makewhatis不存在。 运行man和一个命令可以工作,但aproposwhatis都没有返回除“无适当内容”之外的任何信息。

在寻找缺失的包并搜索一些信息后,我阅读了man页面上友好的手册,并发现了mandb

运行mandb解决了我的问题。


2
在MSYS2中也没有makewhatis,但是mandb可以工作!感谢您的建议 :) - legends2k
6
这个答案同样适用于纯64位的Cygwin。 - aaaantoine

14

来自于Cygwin FAQ:

为什么 man -k (或 apropos) 不起作用?

在使用 man -k 或 apropos 之前,您必须创建 whatis 数据库。只需要运行以下命令:

mandb

(注意: 在早期版本的FAQ中,它使用的是/usr/sbin/makewhatis而不是mandb。)


man 打开手册页面。aproposwhatis 搜索索引以查找相关的手册页面。尝试运行 man manman aproposman whatis 以获取有关它们各自功能的更多详细信息,如果您仍然遇到问题,请随时提出新问题。 - me_and
在 Fedora 上,我必须以 sudo 运行它才能更新。 - Sharpiro

11

执行一次sudo mandb

不确定是否有所帮助,但是当我运行 mandb 时,多次尝试都得到了这个结果。

mandb    
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

然而,

sudo mandb
75 man subdirectories contained newer manual pages.
7235 manual pages were added.
0 stray cats were added.
0 old database entries were purged.

实际运作。


0

我遇到了同样的问题。
我使用#mandb命令解决了它。


0

sudo mandb 对我解决了这个问题。它重新生成了 apropos 数据库,但你必须确保使用 sudo 运行它。


0

我的问题通过运行 #mandb 命令得到了解决。

[root@localhost log]# whatis last
last (1)             - show a listing of last logged in users
[root@localhost log]#

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接