如果不在 Zsh 中打开手册,则无法快速搜索手册
以下命令给出了许多 Zsh 手册
man zsh<tab>
alt text http://dl.getdropbox.com/ u/175564/zsh.png
我想快速浏览它们以搜索单词 compinit。
如何在Zsh的手册中快速搜索compinit这个词?
The following command gives many manuals of Zsh
man zsh<tab>
alt text http://dl.getdropbox.com/u/175564/zsh.png
I would like to browse them fast to search the word compinit.
How can you search the word compinit fast in the manuals in Zsh?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经常为了这种事情
man -k 编译
有效,因为作者足够明智,将大量标识符放入手册页的“简短描述”中。
这里的情况似乎并非如此……所以您将不得不 grep 源代码。 哪个是 gzipped ...
或者如果你没有 zgrep:
有更优雅的方法可以做到这一点,但这为你提供了 compinit 在每个文件中出现的频率的列表:
Often for this kind of thing
man -k compinit
works, because authors are sensible enough to put lots of identifiers into the "short description" of the man page.
This doesn't seem to be the case here ... so you're going to have to grep through the source. Which is gzipped ...
or if you don't have zgrep:
There are more elegant ways to do this, but that gives you a list of how often compinit appears in each file:
使用互联网可能是最好的方法。 另一种方法是使用 zshall 联机帮助页,其中包含所有联机帮助页。 然后,您可以在您使用的任何查看器中搜索 compinit。
编辑:我刚刚想起了一个更好的方法:使用 zsh 的
run-help
函数。这将带您进入 zsh 认为最适合该主题的联机帮助页。 它也适用于非 zsh 相关主题,如 ps、grep 等,但已进行调整以适用于 zsh 主题。
如果由于某种原因
run-help
未加载,您可以使用它来加载。
Using the internet is probably the best way. The other approach is to use the zshall manpage, which contains all the manpages together. You can then search for compinit in whatever viewer you're using.
EDIT: I just remembered a better way of doing this: Use zsh's
run-help
function.This will take you to the manpage that zsh thinks is most appropriate for the topic. It also works for non-zsh related topics like ps, grep, etc, but has been adjusted to work for zsh topics as well.
If for some reason
run-help
isn't loaded, you can useto do so.
您可以使用互联网...所有的手册页都在上面...只需在搜索前加上前缀
(如果您知道它们在硬盘驱动器上的位置...您也许可以 grep 它们...我不知道不知道,因为我自己从来不需要)
You could use the internet... all of the man pages are on it... just prefix your searches with
(If you know where they are located on the harddrive... you might be able to grep them... I don't know as I have not ever needed to myself)